Home / Function/ commitHookLayoutUnmountEffects() — react Function Reference

commitHookLayoutUnmountEffects() — react Function Reference

Architecture documentation for the commitHookLayoutUnmountEffects() function in ReactFiberCommitEffects.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  536f849f_4ed1_3dcd_f2ef_4c117116c0b7["commitHookLayoutUnmountEffects()"]
  8f5342bb_933e_6410_b584_cc120047394a["ReactFiberCommitEffects.js"]
  536f849f_4ed1_3dcd_f2ef_4c117116c0b7 -->|defined in| 8f5342bb_933e_6410_b584_cc120047394a
  5af9a16a_ed89_d37e_b847_bcb6a2805eae["commitDeletionEffectsOnFiber()"]
  5af9a16a_ed89_d37e_b847_bcb6a2805eae -->|calls| 536f849f_4ed1_3dcd_f2ef_4c117116c0b7
  bc4a6de9_07dc_eca7_681a_10f692e08483["commitMutationEffectsOnFiber()"]
  bc4a6de9_07dc_eca7_681a_10f692e08483 -->|calls| 536f849f_4ed1_3dcd_f2ef_4c117116c0b7
  38cb51c8_1ba3_adb6_6b57_5b5853e89841["disappearLayoutEffects()"]
  38cb51c8_1ba3_adb6_6b57_5b5853e89841 -->|calls| 536f849f_4ed1_3dcd_f2ef_4c117116c0b7
  c4d9a9cc_f5a1_3cd7_8ada_0c662e173d45["shouldProfile()"]
  536f849f_4ed1_3dcd_f2ef_4c117116c0b7 -->|calls| c4d9a9cc_f5a1_3cd7_8ada_0c662e173d45
  31dbea93_6a15_5a88_2a94_0513d6287f5a["commitHookEffectListUnmount()"]
  536f849f_4ed1_3dcd_f2ef_4c117116c0b7 -->|calls| 31dbea93_6a15_5a88_2a94_0513d6287f5a
  style 536f849f_4ed1_3dcd_f2ef_4c117116c0b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberCommitEffects.js lines 114–139

export function commitHookLayoutUnmountEffects(
  finishedWork: Fiber,
  nearestMountedAncestor: null | Fiber,
  hookFlags: HookFlags,
) {
  // Layout effects are destroyed during the mutation phase so that all
  // destroy functions for all fibers are called before any create functions.
  // This prevents sibling component effects from interfering with each other,
  // e.g. a destroy function in one component should never override a ref set
  // by a create function in another component during the same commit.
  if (shouldProfile(finishedWork)) {
    startEffectTimer();
    commitHookEffectListUnmount(
      hookFlags,
      finishedWork,
      nearestMountedAncestor,
    );
    recordEffectDuration(finishedWork);
  } else {
    commitHookEffectListUnmount(
      hookFlags,
      finishedWork,
      nearestMountedAncestor,
    );
  }
}

Domain

Subdomains

Frequently Asked Questions

What does commitHookLayoutUnmountEffects() do?
commitHookLayoutUnmountEffects() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCommitEffects.js.
Where is commitHookLayoutUnmountEffects() defined?
commitHookLayoutUnmountEffects() is defined in packages/react-reconciler/src/ReactFiberCommitEffects.js at line 114.
What does commitHookLayoutUnmountEffects() call?
commitHookLayoutUnmountEffects() calls 2 function(s): commitHookEffectListUnmount, shouldProfile.
What calls commitHookLayoutUnmountEffects()?
commitHookLayoutUnmountEffects() is called by 3 function(s): commitDeletionEffectsOnFiber, commitMutationEffectsOnFiber, disappearLayoutEffects.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free