Skip to content

Conversation

gamtiq
Copy link

@gamtiq gamtiq commented Aug 11, 2020

Hello,

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant