react-native-slide-button
react-native-slide-button copied to clipboard
Timeout triggered after component was unmounted
I'm using slider in a modal that will be removed when onSlideSuccess is executed. Problem is that timeout with setState is triggered 1 second after that. In my case component doesn't exist anymore and React complain about it:
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the SlideButton component.
That timeout could be cleared with clearTimeout or fixed in some other way when React component is unmounted.