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

Method addNode

packages/react-aria/src/collections/Document.ts:468–481  ·  view source on GitHub ↗
(element: ElementNode<T>)

Source from the content-addressed store, hash-verified

466 }
467
468 private addNode(element: ElementNode<T>): void {
469 if (element.isHidden || element.node == null) {
470 return;
471 }
472
473 let collection = this.getMutableCollection();
474 if (!collection.getItem(element.node.key)) {
475 for (let child of element) {
476 this.addNode(child);
477 }
478 }
479
480 collection.addNode(element.node);
481 }
482
483 private removeNode(node: ElementNode<T>): void {
484 for (let child of node) {

Callers 1

updateCollectionMethod · 0.95

Calls 2

getMutableCollectionMethod · 0.95
getItemMethod · 0.65

Tested by

no test coverage detected