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 clear rootElement on React #6389

Merged
merged 2 commits into from
Jul 10, 2024
Merged

Fix clear rootElement on React #6389

merged 2 commits into from
Jul 10, 2024

Conversation

zurfyx
Copy link
Member

@zurfyx zurfyx commented Jul 10, 2024

When we introduced the if condition in #5070 we missed the null case.

Copy link

vercel bot commented Jul 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 5:38pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 5:38pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 10, 2024
Copy link

github-actions bot commented Jul 10, 2024

size-limit report 📦

Path Size
lexical - cjs 28.52 KB (0%)
lexical - esm 28.32 KB (0%)
@lexical/rich-text - cjs 36.94 KB (0%)
@lexical/rich-text - esm 28.14 KB (0%)
@lexical/plain-text - cjs 35.51 KB (0%)
@lexical/plain-text - esm 25.34 KB (0%)
@lexical/react - cjs 38.81 KB (0%)
@lexical/react - esm 29.31 KB (0%)

@@ -1011,7 +1011,7 @@ describe('LexicalEditor tests', () => {
await Promise.resolve().then();
});

expect(listener).toHaveBeenCalledTimes(3);
expect(listener).toHaveBeenCalledTimes(4);
Copy link
Member Author

Choose a reason for hiding this comment

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

No idea why it's calling the listener one more time with the HTML reference, and for some reason the useEffect without dependencies will also be unmounted defeating the purpose of this test. If anyone knows more about ReactTestUtils.act I'm all ears

Copy link
Contributor

@StyleT StyleT left a comment

Choose a reason for hiding this comment

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

LGTM!

@zurfyx zurfyx added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit 54c853c Jul 10, 2024
73 of 76 checks passed
2wheeh pushed a commit to 2wheeh/lexical that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants