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

Method removeNode

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

Source from the content-addressed store, hash-verified

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

Callers 1

updateCollectionMethod · 0.95

Calls 2

getMutableCollectionMethod · 0.95
deleteMethod · 0.80

Tested by

no test coverage detected