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

Method removeNode

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

Source from the content-addressed store, hash-verified

499 }
500
501 private removeNode(node: ElementNode<T>): void {
502 for (let child of node) {
503 this.removeNode(child);
504 }
505
506 if (node.node) {
507 let collection = this.getMutableCollection();
508 collection.removeNode(node.node.key);
509 if (process.env.NODE_ENV !== 'production' && this.keyOwners.get(node.node.key) === node) {
510 this.keyOwners.delete(node.node.key);
511 }
512 }
513 }
514
515 /** Finalizes the collection update, updating all nodes and freezing the collection. */
516 getCollection(): C {

Callers 1

updateCollectionMethod · 0.95

Calls 2

getMutableCollectionMethod · 0.95
deleteMethod · 0.80

Tested by

no test coverage detected