react-component / slider

React Slider
https://slider.react-component.now.sh/
MIT License
3.05k stars 776 forks source link

componentWillReceiveProps setState on value=[] #461

Open georgezams opened 6 years ago

georgezams commented 6 years ago

Hi,

I have a parent/child component where my child has the cool react-component slider but when from the parent i change the prop and in the child i setState in the componentWillReceiveProps prop.value = [10,30] the handles lock and are non functional, can you please assist to what i am doing wrong?

OliverLoo commented 6 years ago

Having the same issue. OnChange function works fine until I introduce setState to it, at which point the handles will no longer move.

Function on parent: updateShiftTimes = (times) => { this.setState({ value: { start: start, end: end } }); }

Range slider in child component: <Range marks={marks} min={0} max={23} onChange={(e) => this.updateShiftTimes(e)} />