Open
Description
I’m getting the following warning from a Media-Component which implements a min-width media query:
„Can't perform a React state update on an unmounted component“.
The warning is thrown when the component is already unmounted and the user resizes the window.
It seems as if the event-listener which updates the matches-state is still alive after unmounting.
When inspecting the code I wondered why the initialize-function of Media.js is called two times (1. in constructor, 2. in componentDidMount). Doesn’t this behaviour ends up in eventListeners that will never be removed since in componentWillUnmount only the listeners created in the second call of initialize will be eleminiated?
I’m currently using react-media in version 1.10.0
Metadata
Metadata
Assignees
Labels
No labels