-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Clean up nextEffect pointer #16115
Clean up nextEffect pointer #16115
Conversation
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: 3f1dee0...5f94d0f react-art
react-dom
react-native-renderer
react-test-renderer
react-reconciler
Generated by 🚫 dangerJS |
Thanks @paulshen! Sorry about the long back and forth. |
We've published |
👍 Thanks guys, finally got around to retesting and this definitely fixes the leak in the gatsby starter I made |
16.9 is out too. |
This change clears the
nextEffect
reference when it is no longer needed. If there are no passive effects, we iterate through the effect chain after committing host/layout effects. Otherwise, we remove the pointer while flushing passive effects. Pulled from #15157Without this change, it is possible for live Fiber nodes to have
nextEffect
pointers to unmounted Fiber nodes.Repro
https://gist.github.com/paulshen/8a10c1ac7cd1b2983219e27a08d0f85b
Click "Increment" many times and notice that all unmounted
<InnerBody>
Fiber nodes are retained via anextEffect
chain from<Sidebar>
's Fiber node.With this change,
<Sidebar>
's Fiber node has an emptynextEffect
reference.