react-native-walkthrough-tooltip icon indicating copy to clipboard operation
react-native-walkthrough-tooltip copied to clipboard

Can't perform a React state update on an unmounted component.

Open codasana opened this issue 3 years ago • 6 comments

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!

codasana avatar Feb 11 '21 11:02 codasana

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.

mjangir avatar Aug 14 '21 10:08 mjangir

There is an unmerged PR https://github.com/jasongaare/react-native-walkthrough-tooltip/pull/105 . It happens quite frequently for us as well

jforaker avatar Oct 12 '21 22:10 jforaker

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.

zjkuang avatar Mar 31 '22 23:03 zjkuang

happening to me as well

bmitioglov avatar Jul 01 '22 23:07 bmitioglov

same here.

heedoo avatar Aug 04 '22 19:08 heedoo

Same here

RobertMrowiec avatar Feb 28 '23 14:02 RobertMrowiec