Home > @uniformdev/mesh-sdk-react > setVariablesEditorValue
setVariablesEditorValue() function
Programmatically sets the current value of a variables editor after it has already initialized and become an uncontrolled component. Passing the editorRef
prop to the component will give a reference to editor
, or use ControlledValuePlugin
to manage this automatically.
If newValue is undefined, the editor will be set to an empty state. If newValue is a string, it will be treated as a variable-reference-containing string, and parsed to a Lexical AST If newValue is a serialized Lexical AST, it will be used as-is. If the AST is invalid, the editor will be set to an empty state.
Signature:
Parameters
Parameter | Type | Description |
---|---|---|
editor | LexicalEditor | |
newValue | string | undefined | SerializedEditorState<SerializedLexicalNode> | |
tag | string | (Optional) |
Returns:
void