(parent)
| 5418 | } |
| 5419 | |
| 5420 | function findCurrentHostFiber(parent) { |
| 5421 | var currentParent = findCurrentFiberUsingSlowPath(parent); |
| 5422 | if (!currentParent) { |
| 5423 | return null; |
| 5424 | } |
| 5425 | |
| 5426 | // Next we'll drill down this component to find the first HostComponent/Text. |
| 5427 | var node = currentParent; |
| 5428 | while (true) { |
| 5429 | if (node.tag === HostComponent || node.tag === HostText) { |
| 5430 | return node; |
| 5431 | } else if (node.child) { |
| 5432 | node.child['return'] = node; |
| 5433 | node = node.child; |
| 5434 | continue; |
| 5435 | } |
| 5436 | if (node === currentParent) { |
| 5437 | return null; |
| 5438 | } |
| 5439 | while (!node.sibling) { |
| 5440 | if (!node['return'] || node['return'] === currentParent) { |
| 5441 | return null; |
| 5442 | } |
| 5443 | node = node['return']; |
| 5444 | } |
| 5445 | node.sibling['return'] = node['return']; |
| 5446 | node = node.sibling; |
| 5447 | } |
| 5448 | // Flow needs the return null here, but ESLint complains about it. |
| 5449 | // eslint-disable-next-line no-unreachable |
| 5450 | return null; |
| 5451 | } |
| 5452 | |
| 5453 | function findCurrentHostFiberWithNoPortals(parent) { |
| 5454 | var currentParent = findCurrentFiberUsingSlowPath(parent); |
no test coverage detected