zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
892 stars 231 forks source link

Removed use of `tempArray` #114

Closed lukashlavacka closed 6 years ago

lukashlavacka commented 7 years ago

After updating my project to react@16.0.0 I experienced strange issue where position of handles would be wrong on initial load. After debugging I determined the issue is caused by re-use of tempArray to generate some arrays. As far as I know react uses simple object equality === when detecting changes of props and state. Because the array was re-used in some cases react would fail to detect changes in style object.

Fixes #115

hellosmithy commented 7 years ago

This fixes a bug when upgrading to React 16. Any chance of getting this merged? The re-use of tempArray seems like an unnecessary optimisation anyway.

tobiastornros commented 6 years ago

Please merge this!

misino commented 6 years ago

@mpowaga Hi, would it be possible to merge this fix? Because it is critical for supporting React 16.

mpowaga commented 6 years ago

The same issue has been solved in #121 but thanks for sending this PR @lukashlavacka!