Skip to content

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

Merged
rickhanlonii merged 1 commit into
react:masterfrom
bvaughn:fix-passive-destroy-error-in-unmounted-tree
Aug 5, 2020
Merged

Fix runtime error that happens if a passive destroy function throws within an unmounted tree#19543
rickhanlonii merged 1 commit into
react:masterfrom
bvaughn:fix-passive-destroy-error-in-unmounted-tree

Conversation

@bvaughn

@bvaughn bvaughn commented Aug 5, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

acdlite commented Aug 5, 2020

Copy link
Copy Markdown
Collaborator

Thanks!

@codesandbox-ci

codesandbox-ci Bot commented Aug 5, 2020

Copy link
Copy Markdown

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

sizebot commented Aug 5, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against c54e749

@sizebot

sizebot commented Aug 5, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against c54e749

@rickhanlonii rickhanlonii merged commit e67a6b1 into react: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