MCPcopy Create free account
hub / github.com/adobe/react-spectrum / addNode

Function addNode

packages/react-stately/src/data/useTreeData.ts:260–267  ·  view source on GitHub ↗
(node: TreeNode<T>, map: Map<Key, TreeNode<T>>)

Source from the content-addressed store, hash-verified

258 }
259
260 function addNode(node: TreeNode<T>, map: Map<Key, TreeNode<T>>) {
261 map.set(node.key, node);
262 if (node.children) {
263 for (let child of node.children) {
264 addNode(child, map);
265 }
266 }
267 }
268
269 function deleteNode(node: TreeNode<T>, map: Map<Key, TreeNode<T>>) {
270 map.delete(node.key);

Callers 4

updateMethod · 0.85
updateTreeFunction · 0.85
moveFunction · 0.85
moveItemsFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected