MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / findCurrentHostFiber

Function findCurrentHostFiber

code/redux/public/app.js:5533–5564  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

5531}
5532
5533function findCurrentHostFiber(parent) {
5534 var currentParent = findCurrentFiberUsingSlowPath(parent);
5535 if (!currentParent) {
5536 return null;
5537 }
5538
5539 // Next we'll drill down this component to find the first HostComponent/Text.
5540 var node = currentParent;
5541 while (true) {
5542 if (node.tag === HostComponent || node.tag === HostText) {
5543 return node;
5544 } else if (node.child) {
5545 node.child['return'] = node;
5546 node = node.child;
5547 continue;
5548 }
5549 if (node === currentParent) {
5550 return null;
5551 }
5552 while (!node.sibling) {
5553 if (!node['return'] || node['return'] === currentParent) {
5554 return null;
5555 }
5556 node = node['return'];
5557 }
5558 node.sibling['return'] = node['return'];
5559 node = node.sibling;
5560 }
5561 // Flow needs the return null here, but ESLint complains about it.
5562 // eslint-disable-next-line no-unreachable
5563 return null;
5564}
5565
5566function findCurrentHostFiberWithNoPortals(parent) {
5567 var currentParent = findCurrentFiberUsingSlowPath(parent);

Callers 1

findHostInstanceFunction · 0.70

Calls 1

Tested by

no test coverage detected