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

Move instance.registerEventHandler from createInstance to commitMount in the React reconciler host config #229

Merged
merged 2 commits into from
Nov 26, 2023

Conversation

malash
Copy link
Collaborator

@malash malash commented Nov 26, 2023

According to the doc of createInstance of React reconciler, we should register event handle in the commitMount hook instead of createInstance. Otherwise, it may cause a memory leak problem with error bonding or suspense.

For more details, please see the packages/core/src/reconciler/__tests__/commitMount.test.tsx file in this PR. The reproduction demo is inspired from facebook/react#20271 (comment) .

@malash malash merged commit 124f996 into main Nov 26, 2023
18 checks passed
@malash malash deleted the fix-reconciler-event branch November 26, 2023 15:19
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.

1 participant