getNodeAtPath
react-mosaic-component / getNodeAtPath
Function: getNodeAtPath()
getNodeAtPath<
T>(tree,path):MosaicNode<T> |null
Defined in: libs/react-mosaic-component/src/lib/util/mosaicUtilities.ts:483
Helper to retrieve a node from the tree at a given path. Correctly traverses both 'split' and 'tabs' nodes.
Type Parameters
T
T extends MosaicKey
Parameters
tree
MosaicNode<T> | null
The root of the tree to search.
path
The path to the desired node.
Returns
MosaicNode<T> | null
The node at the path, or null if the path is invalid or the node doesn't exist.