(parent)
| 4513 | } |
| 4514 | |
| 4515 | function findCurrentHostFiber(parent) { |
| 4516 | var currentParent = findCurrentFiberUsingSlowPath(parent); |
| 4517 | if (!currentParent) { |
| 4518 | return null; |
| 4519 | } |
| 4520 | |
| 4521 | // Next we'll drill down this component to find the first HostComponent/Text. |
| 4522 | var node = currentParent; |
| 4523 | while (true) { |
| 4524 | if (node.tag === HostComponent || node.tag === HostText) { |
| 4525 | return node; |
| 4526 | } else if (node.child) { |
| 4527 | node.child['return'] = node; |
| 4528 | node = node.child; |
| 4529 | continue; |
| 4530 | } |
| 4531 | if (node === currentParent) { |
| 4532 | return null; |
| 4533 | } |
| 4534 | while (!node.sibling) { |
| 4535 | if (!node['return'] || node['return'] === currentParent) { |
| 4536 | return null; |
| 4537 | } |
| 4538 | node = node['return']; |
| 4539 | } |
| 4540 | node.sibling['return'] = node['return']; |
| 4541 | node = node.sibling; |
| 4542 | } |
| 4543 | // Flow needs the return null here, but ESLint complains about it. |
| 4544 | // eslint-disable-next-line no-unreachable |
| 4545 | return null; |
| 4546 | } |
| 4547 | |
| 4548 | function findCurrentHostFiberWithNoPortals(parent) { |
| 4549 | var currentParent = findCurrentFiberUsingSlowPath(parent); |
no test coverage detected