Tree
/ API ReferenceTree
/ API Referenceremove
Removes a node by its id.
The Gist
import { remove } from '@weser/tree'
const newTree = remove(tree, 'node-id')
Parameters
| Parameter | Type | Description |
|---|---|---|
| rootNode | T | The root node of the tree. |
| id | string | The id of the node to remove. |
Returns
(T) The updated root node with the node removed.
© 2024-present Robin Weser. All Rights Reserved.