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

Function findFiberRoot

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js:4222–4233  ·  view source on GitHub ↗
(node: Instance)

Source from the content-addressed store, hash-verified

4220export const supportsTestSelectors = true;
4221
4222export function findFiberRoot(node: Instance): null | FiberRoot {
4223 const stack = [node];
4224 let index = 0;
4225 while (index < stack.length) {
4226 const current = stack[index++];
4227 if (isContainerMarkedAsRoot(current)) {
4228 return ((getInstanceFromNodeDOMTree(current): any): FiberRoot);
4229 }
4230 stack.push(...current.children);
4231 }
4232 return null;
4233}
4234
4235export function getBoundingRect(node: Instance): BoundingRect {
4236 const rect = node.getBoundingClientRect();

Callers 1

findFiberRootForHostRootFunction · 0.90

Calls 2

isContainerMarkedAsRootFunction · 0.90
pushMethod · 0.65

Tested by

no test coverage detected