Home > @uniformdev/mesh-sdk-react > ControlledValuePlugin

ControlledValuePlugin() function

Updates the Lexical editor state automatically when a controlled value changes, effectively turning the Lexical editor into a controlled component.

DO NOT USE THIS when actually editing with Lexical as it will cause performance problems. This is intended to be used: * To simplify a read-only "preview" editor, where the user can't edit the value * To sync an external state with the Lexical editor state under certain conditions (i.e. composer mounted, but editor hidden)

Signature:

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

{ enabled, value, extraDependencies, }

</td><td>

{ enabled: boolean; value: string | undefined | SerializedEditorState<SerializedLexicalNode>; extraDependencies?: unknown[]; }

</td><td>

</td></tr> </tbody></table> Returns:

JSX.Element | null