MCPcopy Create free account
hub / github.com/microsoft/SandDance / findCurrentHostFiber

Function findCurrentHostFiber

docs/external/js/react-dom.development.js:3246–3284  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

3244 return alternate;
3245 }
3246 function findCurrentHostFiber(parent) {
3247 var currentParent = findCurrentFiberUsingSlowPath(parent);
3248
3249 if (!currentParent) {
3250 return null;
3251 } // Next we'll drill down this component to find the first HostComponent/Text.
3252
3253
3254 var node = currentParent;
3255
3256 while (true) {
3257 if (node.tag === HostComponent || node.tag === HostText) {
3258 return node;
3259 } else if (node.child) {
3260 node.child.return = node;
3261 node = node.child;
3262 continue;
3263 }
3264
3265 if (node === currentParent) {
3266 return null;
3267 }
3268
3269 while (!node.sibling) {
3270 if (!node.return || node.return === currentParent) {
3271 return null;
3272 }
3273
3274 node = node.return;
3275 }
3276
3277 node.sibling.return = node.return;
3278 node = node.sibling;
3279 } // Flow needs the return null here, but ESLint complains about it.
3280 // eslint-disable-next-line no-unreachable
3281
3282
3283 return null;
3284 }
3285 function findCurrentHostFiberWithNoPortals(parent) {
3286 var currentParent = findCurrentFiberUsingSlowPath(parent);
3287

Callers 2

injectIntoDevToolsFunction · 0.85

Calls 1

Tested by

no test coverage detected