hideOrUnhideAllChildrenOnFiber() — react Function Reference
Architecture documentation for the hideOrUnhideAllChildrenOnFiber() function in ReactFiberCommitWork.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD b736db36_056d_4f77_968a_91554fd127f9["hideOrUnhideAllChildrenOnFiber()"] e0fbfbd5_47b0_a489_0b36_bbfad9245544["ReactFiberCommitWork.js"] b736db36_056d_4f77_968a_91554fd127f9 -->|defined in| e0fbfbd5_47b0_a489_0b36_bbfad9245544 69ff3ebf_7601_0471_b0ed_24a539a28f0b["hideOrUnhideAllChildren()"] 69ff3ebf_7601_0471_b0ed_24a539a28f0b -->|calls| b736db36_056d_4f77_968a_91554fd127f9 59a805c0_c380_fe18_2eca_87082c18ed82["hideOrUnhideNearestPortalsOnFiber()"] 59a805c0_c380_fe18_2eca_87082c18ed82 -->|calls| b736db36_056d_4f77_968a_91554fd127f9 56056703_b8d1_faa3_bd50_32fbdfc4a703["commitShowHideHostInstance()"] b736db36_056d_4f77_968a_91554fd127f9 -->|calls| 56056703_b8d1_faa3_bd50_32fbdfc4a703 2d6edb1f_5f07_32cb_4be6_9a87a4e4142a["hideOrUnhideNearestPortals()"] b736db36_056d_4f77_968a_91554fd127f9 -->|calls| 2d6edb1f_5f07_32cb_4be6_9a87a4e4142a 9f234217_abda_d465_6fbb_2e48f74fc4cc["commitShowHideHostTextInstance()"] b736db36_056d_4f77_968a_91554fd127f9 -->|calls| 9f234217_abda_d465_6fbb_2e48f74fc4cc a941f9d5_1e5c_8d26_0d9c_5418d807d044["commitShowHideSuspenseBoundary()"] b736db36_056d_4f77_968a_91554fd127f9 -->|calls| a941f9d5_1e5c_8d26_0d9c_5418d807d044 69ff3ebf_7601_0471_b0ed_24a539a28f0b["hideOrUnhideAllChildren()"] b736db36_056d_4f77_968a_91554fd127f9 -->|calls| 69ff3ebf_7601_0471_b0ed_24a539a28f0b style b736db36_056d_4f77_968a_91554fd127f9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/ReactFiberCommitWork.js lines 1196–1241
function hideOrUnhideAllChildrenOnFiber(fiber: Fiber, isHidden: boolean) {
if (!supportsMutation) {
return;
}
switch (fiber.tag) {
case HostComponent:
case HostHoistable: {
// Found the nearest host component. Hide it.
commitShowHideHostInstance(fiber, isHidden);
// Typically, only the nearest host nodes need to be hidden, since that
// has the effect of also hiding everything inside of them.
//
// However, there's a special case for portals, because portals do not
// exist in the regular host tree hierarchy; we can't assume that just
// because a portal's HostComponent parent in the React tree will also be
// a parent in the actual host tree.
//
// So, if any portals exist within the tree, regardless of how deeply
// nested they are, we need to repeat this algorithm for its children.
hideOrUnhideNearestPortals(fiber, isHidden);
return;
}
case HostText: {
commitShowHideHostTextInstance(fiber, isHidden);
return;
}
case DehydratedFragment: {
commitShowHideSuspenseBoundary(fiber, isHidden);
return;
}
case OffscreenComponent:
case LegacyHiddenComponent: {
const offscreenState: OffscreenState | null = fiber.memoizedState;
if (offscreenState !== null) {
// Found a nested Offscreen component that is hidden.
// Don't search any deeper. This tree should remain hidden.
} else {
hideOrUnhideAllChildren(fiber, isHidden);
}
return;
}
default: {
hideOrUnhideAllChildren(fiber, isHidden);
return;
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does hideOrUnhideAllChildrenOnFiber() do?
hideOrUnhideAllChildrenOnFiber() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCommitWork.js.
Where is hideOrUnhideAllChildrenOnFiber() defined?
hideOrUnhideAllChildrenOnFiber() is defined in packages/react-reconciler/src/ReactFiberCommitWork.js at line 1196.
What does hideOrUnhideAllChildrenOnFiber() call?
hideOrUnhideAllChildrenOnFiber() calls 5 function(s): commitShowHideHostInstance, commitShowHideHostTextInstance, commitShowHideSuspenseBoundary, hideOrUnhideAllChildren, hideOrUnhideNearestPortals.
What calls hideOrUnhideAllChildrenOnFiber()?
hideOrUnhideAllChildrenOnFiber() is called by 2 function(s): hideOrUnhideAllChildren, hideOrUnhideNearestPortalsOnFiber.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free