reappearLayoutEffects() — react Function Reference
Architecture documentation for the reappearLayoutEffects() function in ReactFiberCommitWork.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 1846396a_6bcb_7ad4_8180_1d20ef2960a4["reappearLayoutEffects()"] e0fbfbd5_47b0_a489_0b36_bbfad9245544["ReactFiberCommitWork.js"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|defined in| e0fbfbd5_47b0_a489_0b36_bbfad9245544 c06df62d_18bb_abfc_ffdc_0712d0bf021d["recursivelyTraverseReappearLayoutEffects()"] c06df62d_18bb_abfc_ffdc_0712d0bf021d -->|calls| 1846396a_6bcb_7ad4_8180_1d20ef2960a4 4f76ed87_f151_2295_8bb4_c7b5dfe010a2["pushComponentEffectStart()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 4f76ed87_f151_2295_8bb4_c7b5dfe010a2 da570743_1675_9fe9_6425_06d6a84f49ba["pushComponentEffectDuration()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| da570743_1675_9fe9_6425_06d6a84f49ba c06df62d_18bb_abfc_ffdc_0712d0bf021d["recursivelyTraverseReappearLayoutEffects()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| c06df62d_18bb_abfc_ffdc_0712d0bf021d a9dc2423_dea6_d2a0_0ec6_d7730bfd6c66["commitHookLayoutEffects()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| a9dc2423_dea6_d2a0_0ec6_d7730bfd6c66 2658d7f3_2abd_b316_7515_e744c781f951["commitClassDidMount()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 2658d7f3_2abd_b316_7515_e744c781f951 1742f4ab_88cb_1f5c_9378_61760e273398["commitClassCallbacks()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 1742f4ab_88cb_1f5c_9378_61760e273398 23ba532d_d2ea_c5f1_a931_97dc52085704["commitHostMount()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 23ba532d_d2ea_c5f1_a931_97dc52085704 0173a090_1c78_3da9_68fd_5bfa21600acc["pushNestedEffectDurations()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 0173a090_1c78_3da9_68fd_5bfa21600acc 2bc3a25f_8722_3ff5_8d20_3b3d595f7eda["bubbleNestedEffectDurations()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 2bc3a25f_8722_3ff5_8d20_3b3d595f7eda 9b0f5b9a_5907_c1d2_699c_448228d8f869["commitActivityHydrationCallbacks()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 9b0f5b9a_5907_c1d2_699c_448228d8f869 90c5704e_45a8_2cca_2db9_01987c87dfd0["commitSuspenseHydrationCallbacks()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| 90c5704e_45a8_2cca_2db9_01987c87dfd0 f5e9b57a_352d_e8a8_306f_de8b1f7fa76f["trackNamedViewTransition()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| f5e9b57a_352d_e8a8_306f_de8b1f7fa76f ff9409a2_b556_06af_85c9_ee748a528d80["popComponentEffectStart()"] 1846396a_6bcb_7ad4_8180_1d20ef2960a4 -->|calls| ff9409a2_b556_06af_85c9_ee748a528d80 style 1846396a_6bcb_7ad4_8180_1d20ef2960a4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/ReactFiberCommitWork.js lines 3105–3330
export function reappearLayoutEffects(
finishedRoot: FiberRoot,
current: Fiber | null,
finishedWork: Fiber,
// This function visits both newly finished work and nodes that were re-used
// from a previously committed tree. We cannot check non-static flags if the
// node was reused.
includeWorkInProgressEffects: boolean,
) {
const prevEffectStart = pushComponentEffectStart();
const prevEffectDuration = pushComponentEffectDuration();
const prevEffectErrors = pushComponentEffectErrors();
const prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
// Turn on layout effects in a tree that previously disappeared.
const flags = finishedWork.flags;
switch (finishedWork.tag) {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent: {
recursivelyTraverseReappearLayoutEffects(
finishedRoot,
finishedWork,
includeWorkInProgressEffects,
);
// TODO: Check flags & LayoutStatic
commitHookLayoutEffects(finishedWork, HookLayout);
break;
}
case ClassComponent: {
recursivelyTraverseReappearLayoutEffects(
finishedRoot,
finishedWork,
includeWorkInProgressEffects,
);
commitClassDidMount(finishedWork);
commitClassHiddenCallbacks(finishedWork);
// If this is newly finished work, check for setState callbacks
if (includeWorkInProgressEffects && flags & Callback) {
commitClassCallbacks(finishedWork);
}
// TODO: Check flags & RefStatic
safelyAttachRef(finishedWork, finishedWork.return);
break;
}
// Unlike commitLayoutEffectsOnFiber, we don't need to handle HostRoot
// because this function only visits nodes that are inside an
// Offscreen fiber.
// case HostRoot: {
// ...
// }
case HostSingleton: {
if (supportsSingletons) {
// We acquire the singleton instance first so it has appropriate
// styles before other layout effects run. This isn't perfect because
// an early sibling of the singleton may have an effect that can
// observe the singleton before it is acquired.
// @TODO move this to the mutation phase. The reason it isn't there yet
// is it seemingly requires an extra traversal because we need to move the
// disappear effect into a phase before the appear phase
commitHostSingletonAcquisition(finishedWork);
// We fall through to the HostComponent case below.
}
// Fallthrough
}
case HostHoistable:
case HostComponent: {
// TODO: Enable HostText for RN
if (enableFragmentRefs && finishedWork.tag === HostComponent) {
commitFragmentInstanceInsertionEffects(finishedWork);
}
recursivelyTraverseReappearLayoutEffects(
finishedRoot,
finishedWork,
includeWorkInProgressEffects,
);
// Renderers may schedule work to be done after host components are mounted
Domain
Subdomains
Calls
- bubbleNestedEffectDurations()
- commitActivityHydrationCallbacks()
- commitClassCallbacks()
- commitClassDidMount()
- commitHookLayoutEffects()
- commitHostMount()
- commitSuspenseHydrationCallbacks()
- popComponentEffectDuration()
- popComponentEffectStart()
- pushComponentEffectDuration()
- pushComponentEffectStart()
- pushNestedEffectDurations()
- recursivelyTraverseReappearLayoutEffects()
- trackNamedViewTransition()
Source
Frequently Asked Questions
What does reappearLayoutEffects() do?
reappearLayoutEffects() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCommitWork.js.
Where is reappearLayoutEffects() defined?
reappearLayoutEffects() is defined in packages/react-reconciler/src/ReactFiberCommitWork.js at line 3105.
What does reappearLayoutEffects() call?
reappearLayoutEffects() calls 14 function(s): bubbleNestedEffectDurations, commitActivityHydrationCallbacks, commitClassCallbacks, commitClassDidMount, commitHookLayoutEffects, commitHostMount, commitSuspenseHydrationCallbacks, popComponentEffectDuration, and 6 more.
What calls reappearLayoutEffects()?
reappearLayoutEffects() is called by 1 function(s): recursivelyTraverseReappearLayoutEffects.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free