expo / react-native-read-more-text

582 stars 114 forks source link

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. #39

Open dlenskyi opened 3 years ago

dlenskyi commented 3 years ago

I'm getting warning

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.
at node_modules/react/cjs/react.development.js:471:2 in Component.prototype.setState
at node_modules/react-native-read-more-text/index.js:11:2 in ReadMore#componentDidMount
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue

Anyone can help me with that please?

Randall71 commented 3 years ago

This is not an issue with this library but with your state update in your application. to fix this check https://www.debuggr.io/react-update-unmounted-component/