Skip to main content

$copyNode

function

Returns a shallow clone of node with a new key. All properties of the node will be copied to the new node (by `clone` and then `afterCloneFrom`), except those related to parent/sibling/child relationships in the `EditorState`. This means that the copy must be separately added to the document, and it will not have any children.

function $copyNode<T extends LexicalNode>(node: T, skipReset?: boolean): T

Import

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

Notes

returns
The copy of the node.