LexicalComposer
TheLexicalComposer component is the root context provider for Lexical React applications. It creates and initializes a Lexical editor instance and provides it to child components via React context.
Props
Configuration object for the editor
Child components that will have access to the editor context.
LexicalComposerContext
Context object that provides the editor instance and theme accessor to child components.useLexicalComposerContext
Hook to access the editor instance and context from within aLexicalComposer.
[LexicalEditor, LexicalComposerContextType]
LexicalEditor- The editor instanceLexicalComposerContextType- Context object withgetTheme()method
LexicalComposer
LexicalNestedComposer
Context provider for nested editors (editors within decorators or other editors).Props
The nested editor instance, created with
createEditor().Child components and plugins for the nested editor. Note: plugins are not inherited from the parent editor.
Optional theme to override the editor’s theme.
Deprecated: This feature is not safe and will be removed in v0.32.0. Configure nodes when creating the editor instead.
If
true, renders children immediately even if collaboration plugin is active. Otherwise waits for collab to be ready.If
true, the nested editor manages its own editable state. Otherwise, it inherits from the parent editor.createLexicalComposerContext
Utility function to create a composer context object. Used internally byLexicalComposer and LexicalNestedComposer.
Parameters
Parent context for nested composers, or
null for root composers.Theme configuration. If
null, inherits from parent.Returns
LexicalComposerContextType object with a getTheme() method that returns the current theme.