(node: DOMElement | TextNode)
| 444 | // freeRecursive() frees the node and ALL its children, so we must clear |
| 445 | // all yogaNode references to prevent dangling pointers. |
| 446 | export const clearYogaNodeReferences = (node: DOMElement | TextNode): void => { |
| 447 | if ('childNodes' in node) { |
| 448 | for (const child of node.childNodes) { |
| 449 | clearYogaNodeReferences(child) |
| 450 | } |
| 451 | } |
| 452 | node.yogaNode = undefined |
| 453 | } |
| 454 | |
| 455 | /** |
| 456 | * Find the React component stack responsible for content at screen row `y`. |