When using Lexical v0.37.0 with React Server Components (RSC), the following warning appears:
Missing getServerSnapshot, which is required for server-rendered content.
This occurs in @lexical/react/LexicalReactExtension.dev.mjs where useSyncExternalStore is called without the required getServerSnapshot function, causing hydration issues in RSC environments.
|
const decorators = useSyncExternalStore(subscribe, getSnapshot); |
Steps to reproduce:
- Use Lexical v0.37.0 in a RSCapp.
- Render a Lexical editor or extension.
- Observe the warning in the console.
Expected behavior:
Lexical should provide a getServerSnapshot function to useSyncExternalStore to ensure compatibility with RSC.