react-native-slide-button icon indicating copy to clipboard operation
react-native-slide-button copied to clipboard

Timeout triggered after component was unmounted

Open anttimann opened this issue 9 years ago • 0 comments

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.

anttimann avatar Oct 07 '16 10:10 anttimann