MCPcopy Index your code
hub / github.com/react/react / getHostNode

Function getHostNode

packages/react-native-renderer/src/ReactNativeFiberInspector.js:64–78  ·  view source on GitHub ↗
(fiber: Fiber | null)

Source from the content-addressed store, hash-verified

62 };
63
64 const getHostNode = function (fiber: Fiber | null) {
65 let hostNode;
66 // look for children first for the hostNode
67 // as composite fibers do not have a hostNode
68 while (fiber) {
69 if (fiber.stateNode !== null && fiber.tag === HostComponent) {
70 hostNode = findNodeHandle(fiber.stateNode);
71 }
72 if (hostNode) {
73 return hostNode;
74 }
75 fiber = fiber.child;
76 }
77 return null;
78 };
79
80 const getHostProps = function (fiber: Fiber) {
81 const host = findCurrentHostFiber(fiber);

Callers 1

createHierarchyFunction · 0.85

Calls 1

findNodeHandleFunction · 0.90

Tested by

no test coverage detected