react-native-walkthrough-tooltip
react-native-walkthrough-tooltip copied to clipboard
Can't perform a React state update on an unmounted component.
I'm using the Tooltip as follows:
<Tooltip
isVisible={showGuide}
content={renderTT()}
placement="center"
onClose={() => console.log('closed')}
><View><Text>Here</Text></View>
</Tooltip>
The renderTT() function returns a view for the tooltip and also sets the state of showGuide to false - setShowGuide(false).
The problem happens when I navigate to another screen or previous screen. It shows a warning as follows pointing to this line in my screen:
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
Can you please help with why this is happening and how I can resolve it?
Thanks!
This is happening because when the tooltip is trying to set its state to get itself hidden, the component is no longer available and is unmounted.
There is an unmerged PR https://github.com/jasongaare/react-native-walkthrough-tooltip/pull/105 . It happens quite frequently for us as well
There is an unmerged PR #105 . It happens quite frequently for us as well
We applied PR #105 with patch-package but the issue is still there. So PR #105 didn't fix this issue.
happening to me as well
same here.
Same here