Skip to content
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

Fix runtime error that happens if a passive destroy function throws within an unmounted tree #19543

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Aug 5, 2020

A passive effect's cleanup function may throw after an unmount. In that event, React sometimes threw an uncaught runtime error trying to access a property on a null stateNode field. This commit fixes that (and adds a regression test).

…ithin an unmounted tree

A passive effect's cleanup function may throw after an unmount. In that event, React sometimes threw an uncaught runtime error trying to access a property on a null stateNode field. This commit fixes that (and adds a regression test).
// 'LogOnlyErrorBoundary componentDidCatch',
]);
});
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll add a few more tests to this new block in the follow up PR #19542

@acdlite
Copy link
Collaborator

acdlite commented Aug 5, 2020

Thanks!

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 5, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c54e749:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Aug 5, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against c54e749

@sizebot
Copy link

sizebot commented Aug 5, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against c54e749

@rickhanlonii rickhanlonii merged commit e67a6b1 into facebook:master Aug 5, 2020
@bvaughn bvaughn deleted the fix-passive-destroy-error-in-unmounted-tree branch August 5, 2020 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants