I encountered the following React's warning when running unit tests for a component that is wrapping react-truncate:
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.
I researched and found that the problem is related to non-canceled requestAnimationFrame callback which asynchronously calls a function specified in onTruncate prop.
The proposed change eliminates the warning.
Hello,
I encountered the following React's warning when running unit tests for a component that is wrapping
react-truncate
:I researched and found that the problem is related to non-canceled
requestAnimationFrame
callback which asynchronously calls a function specified inonTruncate
prop. The proposed change eliminates the warning.