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

BaseVariableNode class

A variable reference node without a renderer, for headless (server-side) Lexical editors. VariableNode extends it with the React renderer; keep this module free of React imports.

Signature:

Extends: DecoratorNode<T>

Constructors

Constructor

Modifiers

Description

(constructor)(reference, state, key)

Constructs a new instance of the BaseVariableNode class

Properties

Property

Modifiers

Type

Description

__variableState

VariableNodeState

reference

Readonly<string>

Methods

Method

Modifiers

Description

clone(node)

static

createDOM()

Creates the DOM wrapper that hosts the node

exportJSON()

Serializes the node to JSON for editor initial state

getState()

Gets the node's current state

getTextContent()

Copy variable to clipboard in a format we will read back if pasted (albeit it won't get the fancy chip-node)

getType()

static

importDOM()

static

importJSON(serializedNode)

static

Imports the node from serialized JSON (i.e. the data provided to the editor's initial state)

setState(state)

Updates the node's variables state so it knows its current validity, display name, etc The plugin updates this whenever the variables prop changes.

updateDOM()