Skip to content

Function: cloneSubtree()

cloneSubtree<TRow>(options): CloneSubtreeResult<TRow>

Defined in: src/tree-editor/clone-subtree.ts:35

Deep-clone the subtree rooted at rootId. Every node receives a fresh id from generateId, and parent/child relationships are rewired to the new ids. The source state is not modified.

Throws when rootId is not present in state.

Type Parameters

TRow

TRow

Parameters

options

CloneSubtreeOptions<TRow>

Returns

CloneSubtreeResult<TRow>