[lexical-react] Bug Fix: LexicalTypeaheadMenuPlugin SSR error: ReferenceError: document is not defined#6794
Merged
etrepum merged 7 commits intofacebook:mainfrom Nov 5, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
etrepum
reviewed
Nov 5, 2024
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
I think that the LexicalMenu anchorElementRef type should change to match the new expectations rather than using a cast. It's a mutable object, the contents can change from not-null to null at any time (at least per the type contract)
etrepum
previously approved these changes
Nov 5, 2024
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
I think this is good to go, I will apply the small suggested nit and assuming the e2e test suite looks good then it will be merged. Thank you!
etrepum
approved these changes
Nov 5, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Used
CAN_USE_DOMto check if the DOM can be used when accessing the document object in theuseMenuAnchorRefhook. This prevents runtime errors when the hook is used by a plugin in SSR.Closes #6716
Test plan
Unit test has been added for
useMenuAnchorRef.