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

Method removeChild

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

Source from the content-addressed store, hash-verified

183 }
184
185 removeChild(child: ElementNode<T>): void {
186 if (child.parentNode !== this) {
187 return;
188 }
189
190 if (this._minInvalidChildIndex === child) {
191 this._minInvalidChildIndex = null;
192 }
193
194 if (child.nextSibling) {
195 this.invalidateChildIndices(child.nextSibling);
196 child.nextSibling.previousSibling = child.previousSibling;
197 }
198
199 if (child.previousSibling) {
200 child.previousSibling.nextSibling = child.nextSibling;
201 }
202
203 if (this.firstChild === child) {
204 this.firstChild = child.nextSibling;
205 }
206
207 if (this.lastChild === child) {
208 this.lastChild = child.previousSibling;
209 }
210
211 child.parentNode = null;
212 child.nextSibling = null;
213 child.previousSibling = null;
214 child.index = 0;
215
216 this.ownerDocument.markDirty(child);
217 if (this.isConnected) {
218 this.ownerDocument.queueUpdate();
219 }
220 }
221
222 addEventListener(): void {}
223 removeEventListener(): void {}

Callers 3

appendChildMethod · 0.45
insertBeforeMethod · 0.45
Hidden.tsxFile · 0.45

Calls 3

markDirtyMethod · 0.80
queueUpdateMethod · 0.80

Tested by

no test coverage detected