Function: getSelectedNode

getSelectedNode(selection): TextNode | ElementNode | null

Gets the selected node from the Lexical editor.

Parameters

NameType
selectionRangeSelection

Returns

TextNode | ElementNode | null