(parent)
| 5047 | } |
| 5048 | |
| 5049 | function findCurrentHostFiber(parent) { |
| 5050 | var currentParent = findCurrentFiberUsingSlowPath(parent); |
| 5051 | if (!currentParent) { |
| 5052 | return null; |
| 5053 | } |
| 5054 | |
| 5055 | // Next we'll drill down this component to find the first HostComponent/Text. |
| 5056 | var node = currentParent; |
| 5057 | while (true) { |
| 5058 | if (node.tag === HostComponent || node.tag === HostText) { |
| 5059 | return node; |
| 5060 | } else if (node.child) { |
| 5061 | node.child.return = node; |
| 5062 | node = node.child; |
| 5063 | continue; |
| 5064 | } |
| 5065 | if (node === currentParent) { |
| 5066 | return null; |
| 5067 | } |
| 5068 | while (!node.sibling) { |
| 5069 | if (!node.return || node.return === currentParent) { |
| 5070 | return null; |
| 5071 | } |
| 5072 | node = node.return; |
| 5073 | } |
| 5074 | node.sibling.return = node.return; |
| 5075 | node = node.sibling; |
| 5076 | } |
| 5077 | // Flow needs the return null here, but ESLint complains about it. |
| 5078 | // eslint-disable-next-line no-unreachable |
| 5079 | return null; |
| 5080 | } |
| 5081 | |
| 5082 | function findCurrentHostFiberWithNoPortals(parent) { |
| 5083 | var currentParent = findCurrentFiberUsingSlowPath(parent); |
no test coverage detected