Skip to main content

$nodesOfType

function

Returns all nodes of the given type in the active editor state. Consider LexicalEditor.registerMutationListener with `skipInitialization: false` instead if you need to track these nodes over time rather than read them once.

function $nodesOfType<T extends LexicalNode>(klass: Klass<T>): T[]

Import

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