-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug componentWillUnmount is called before componentDidMount #5719
Comments
Just tried this example and I can confirm this behaviour exists. Is it expected behaviour to prevent memory leaks and clean something from constructor even if component is not mounted yet? |
This might be #2410. |
@istarkov @chicoxyzzy @spicyj The related issue #2410 has been closed, should this issue be closed, too (if stopped reproducing)? |
The jsbin is broken in 15.0.2 and fixed in 15.1.0 so almost certainly that, thanks. |
I'm experiencing this issue with React 15.5.4 while using React-Modal. |
If you're experiencing an issue please create an example reproducing it. Then we can diagnose it. Thanks! |
Sorry, I forgot to attach the example link. But forget it, the bug was caused by |
In some cases, `componentWillUnmount` is called before `componentDidMount`, which leaves `this.scrollbar` as null and causes a `Cannot read property 'destroy' of null` error. [See this issue in React](facebook/react#5719)
React 0.14.3
componentWillUnmount
is called beforecomponentDidMount
, but this must be impossible.As additional check: calling
findDomNode
insidecomponentDidMount
causesInvariant Violation: findDOMNode was called on an unmounted component
.code example and output jsbin example
code output of example above
The text was updated successfully, but these errors were encountered: