Tree
/ API Reference
Tree
/ API Reference

remove

Removes a node by its id.

The Gist

import { remove } from '@weser/tree'

const newTree = remove(tree, 'node-id')

Parameters

ParameterTypeDescription
rootNodeTThe root node of the tree.
idstringThe id of the node to remove.

Returns

(T) The updated root node with the node removed.

On this page