Open 6ase opened 6 months ago
@6ase did you found any solution around it?
@6ase did you found any solution around it?
I changed my redux actions to update only the one of parametrs. So fo each command - i create function that is not mutate other values
It seems there is a problem inside of component with "stale closure". I`am use the function to provide to onComplete:
"device" - object i am getting from the props or from selector
const device = useSelector(getDeviceInfo(id), _.isEqual)
The problem is: when i call onSlidingComplete - function, the device.state has an old state, even, i a checked by console.log(device.state) in the compopent and device.state in the function on onSlidingComplete - there are different values.The problem is, that i change state of temperature in CircleSlider, trying to update main state
but if change in another component, for example device.state.fan_speed - device.state inside of onSlidingComplete didnt know about that..
If i use some standard sliders from react-native - all work fine.