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(core): don't append to unmounted containers #2472

Merged
merged 2 commits into from
Sep 1, 2022

Conversation

CodyJasonBennett
Copy link
Member

Fixes #2469 by ensuring that containers passed to createPortal are mounted and managed by R3F before appending. In this case, React removes the parent container and then tries to re-append its child container, which is undefined behavior.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 31, 2022

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 d639c88:

Sandbox Source
example Configuration
createportal-crash Issue #2469

@CodyJasonBennett CodyJasonBennett merged commit 65b1939 into master Sep 1, 2022
@CodyJasonBennett CodyJasonBennett deleted the fix/external-container branch September 1, 2022 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createPortal crashes when parent changes
2 participants