NestedLexicalEditor variable

A nested editor React component that allows editing of the contents of complex markdown nodes that have nested markdown content (for example, custom directives or JSX elements). See the NestedEditorProps for more details on the compoment props.


NestedLexicalEditor: <T extends Mdast.Content>(props: NestedEditorProps<T>) => React.JSX.Element


You can use a type param to specify the type of the mdast node

interface CalloutDirectiveNode extends LeafDirective {
  name: 'callout'
  children: Mdast.PhrasingContent[]

return <NestedLexicalEditor<CalloutDirectiveNode> getContent={node => node.children} getUpdatedMdastNode={(node, children) => ({ ...node, children })} />