MCPcopy Index your code
hub / github.com/adobe/react-spectrum / update

Function update

packages/react-stately/src/data/useTreeData.ts:452–472  ·  view source on GitHub ↗
(oldKey: Key, newValue: T)

Source from the content-addressed store, hash-verified

450 });
451 },
452 update(oldKey: Key, newValue: T) {
453 setItems(({items, nodeMap: originalMap}) =>
454 updateTree(
455 items,
456 oldKey,
457 oldNode => {
458 let node: TreeNode<T> = {
459 key: oldNode.key,
460 parentKey: oldNode.parentKey,
461 value: newValue,
462 children: null
463 };
464
465 let tree = buildTree(getChildren(newValue), originalMap, node.key);
466 node.children = tree.items;
467 return node;
468 },
469 originalMap
470 )
471 );
472 }
473 };
474}
475

Callers 1

updateTreeFunction · 0.70

Calls 3

updateTreeFunction · 0.85
buildTreeFunction · 0.85
getChildrenFunction · 0.85

Tested by

no test coverage detected