facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
19.95k stars 1.7k forks source link

[lexical-react] Bug Fix: LexicalTypeaheadMenuPlugin SSR error: ReferenceError: document is not defined #6794

Closed bedre7 closed 2 weeks ago

bedre7 commented 2 weeks ago

Description

Used CAN_USE_DOM to check if the DOM can be used when accessing the document object in the useMenuAnchorRef hook. 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.

vercel[bot] commented 2 weeks ago

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 Nov 5, 2024 4:44pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 4:44pm
github-actions[bot] commented 2 weeks ago

size-limit report 📦

Path Size
lexical - cjs 29.92 KB (0%)
lexical - esm 29.78 KB (0%)
@lexical/rich-text - cjs 38.57 KB (0%)
@lexical/rich-text - esm 31.63 KB (0%)
@lexical/plain-text - cjs 37.22 KB (0%)
@lexical/plain-text - esm 28.94 KB (0%)
@lexical/react - cjs 40.31 KB (0%)
@lexical/react - esm 33.04 KB (0%)