Skip to main content

$getNearestNodeFromDOMNode

function

Returns the nearest LexicalNode by walking up the DOM tree from the given node, or null if no Lexical node is found.

function $getNearestNodeFromDOMNode(startingDOM: Node, editorState?: EditorState): LexicalNode | null

Import

import { $getNearestNodeFromDOMNode } from '@modular/sdk/editor';