commitPassiveMountOnFiber() — react Function Reference
Architecture documentation for the commitPassiveMountOnFiber() function in ReactFiberCommitWork.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1["commitPassiveMountOnFiber()"] e0fbfbd5_47b0_a489_0b36_bbfad9245544["ReactFiberCommitWork.js"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|defined in| e0fbfbd5_47b0_a489_0b36_bbfad9245544 3b48a9a7_8dba_165e_d034_0aaca1b42cdc["commitPassiveMountEffects()"] 3b48a9a7_8dba_165e_d034_0aaca1b42cdc -->|calls| 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 c48b98f7_7633_34a8_3e32_977f9b8453fe["recursivelyTraversePassiveMountEffects()"] c48b98f7_7633_34a8_3e32_977f9b8453fe -->|calls| 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 4f76ed87_f151_2295_8bb4_c7b5dfe010a2["pushComponentEffectStart()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 4f76ed87_f151_2295_8bb4_c7b5dfe010a2 da570743_1675_9fe9_6425_06d6a84f49ba["pushComponentEffectDuration()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| da570743_1675_9fe9_6425_06d6a84f49ba c48b98f7_7633_34a8_3e32_977f9b8453fe["recursivelyTraversePassiveMountEffects()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| c48b98f7_7633_34a8_3e32_977f9b8453fe a91297ff_1cc6_aa85_0c1f_efacbbff1de9["commitHookPassiveMountEffects()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| a91297ff_1cc6_aa85_0c1f_efacbbff1de9 0173a090_1c78_3da9_68fd_5bfa21600acc["pushNestedEffectDurations()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 0173a090_1c78_3da9_68fd_5bfa21600acc 9b153302_815a_1f5e_73cd_e59240aaf8f6["retainCache()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 9b153302_815a_1f5e_73cd_e59240aaf8f6 403ebde6_eb4f_5227_0cbf_8f26881eabc7["releaseCache()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 403ebde6_eb4f_5227_0cbf_8f26881eabc7 006c62ff_dc21_a892_060f_b8af1c4c9d34["popNestedEffectDurations()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 006c62ff_dc21_a892_060f_b8af1c4c9d34 2bc3a25f_8722_3ff5_8d20_3b3d595f7eda["bubbleNestedEffectDurations()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 2bc3a25f_8722_3ff5_8d20_3b3d595f7eda 2d036adb_abc2_6b17_a780_276a2848fe77["commitOffscreenPassiveMountEffects()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 2d036adb_abc2_6b17_a780_276a2848fe77 317d36b2_6d53_a2b7_dca2_deda0b86219e["recursivelyTraverseAtomicPassiveEffects()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| 317d36b2_6d53_a2b7_dca2_deda0b86219e ea4de162_c0d1_f2e2_cc55_bbca4c7974d7["recursivelyTraverseReconnectPassiveEffects()"] 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 -->|calls| ea4de162_c0d1_f2e2_cc55_bbca4c7974d7 style 07f3c6d9_2fce_51ae_4408_e0d4ab7359a1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-reconciler/src/ReactFiberCommitWork.js lines 3571–4182
function commitPassiveMountOnFiber(
finishedRoot: FiberRoot,
finishedWork: Fiber,
committedLanes: Lanes,
committedTransitions: Array<Transition> | null,
endTime: number, // Profiling-only. The start time of the next Fiber or root completion.
): void {
const prevEffectStart = pushComponentEffectStart();
const prevEffectDuration = pushComponentEffectDuration();
const prevEffectErrors = pushComponentEffectErrors();
const prevEffectDidSpawnUpdate = pushComponentEffectDidSpawnUpdate();
const prevDeepEquality = pushDeepEquality();
const isViewTransitionEligible = enableViewTransition
? includesOnlyViewTransitionEligibleLanes(committedLanes)
: false;
if (
isViewTransitionEligible &&
finishedWork.alternate === null &&
// We can't use the Placement flag here because it gets reset earlier. Instead,
// we check if this is the root of the insertion by checking if the parent
// was previous existing.
finishedWork.return !== null &&
finishedWork.return.alternate !== null
) {
// This was a new mount. This means we could've triggered an enter animation on
// the content. Restore the view transitions if there were any assigned in the
// snapshot phase.
restoreEnterOrExitViewTransitions(finishedWork);
}
// When updating this function, also update reconnectPassiveEffects, which does
// most of the same things when an offscreen tree goes from hidden -> visible,
// or when toggling effects inside a hidden tree.
const flags = finishedWork.flags;
switch (finishedWork.tag) {
case FunctionComponent:
case ForwardRef:
case SimpleMemoComponent: {
// If this component rendered in Profiling mode (DEV or in Profiler component) then log its
// render time. We do this after the fact in the passive effect to avoid the overhead of this
// getting in the way of the render characteristics and avoid the overhead of unwinding
// uncommitted renders.
if (
enableProfilerTimer &&
enableComponentPerformanceTrack &&
(finishedWork.mode & ProfileMode) !== NoMode &&
((finishedWork.actualStartTime: any): number) > 0 &&
(finishedWork.flags & PerformedWork) !== NoFlags
) {
logComponentRender(
finishedWork,
((finishedWork.actualStartTime: any): number),
endTime,
inHydratedSubtree,
committedLanes,
);
}
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
committedLanes,
committedTransitions,
endTime,
);
if (flags & Passive) {
commitHookPassiveMountEffects(
finishedWork,
HookPassive | HookHasEffect,
);
}
break;
}
case ClassComponent: {
// If this component rendered in Profiling mode (DEV or in Profiler component) then log its
// render time. We do this after the fact in the passive effect to avoid the overhead of this
// getting in the way of the render characteristics and avoid the overhead of unwinding
// uncommitted renders.
if (
Domain
Subdomains
Calls
- bubbleNestedEffectDurations()
- commitCachePassiveMountEffect()
- commitHookPassiveMountEffects()
- commitOffscreenPassiveMountEffects()
- commitTracingMarkerPassiveMountEffect()
- popComponentEffectDuration()
- popComponentEffectStart()
- popNestedEffectDurations()
- pushComponentEffectDuration()
- pushComponentEffectStart()
- pushNestedEffectDurations()
- recursivelyTraverseAtomicPassiveEffects()
- recursivelyTraversePassiveMountEffects()
- recursivelyTraverseReconnectPassiveEffects()
- releaseCache()
- retainCache()
Source
Frequently Asked Questions
What does commitPassiveMountOnFiber() do?
commitPassiveMountOnFiber() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberCommitWork.js.
Where is commitPassiveMountOnFiber() defined?
commitPassiveMountOnFiber() is defined in packages/react-reconciler/src/ReactFiberCommitWork.js at line 3571.
What does commitPassiveMountOnFiber() call?
commitPassiveMountOnFiber() calls 16 function(s): bubbleNestedEffectDurations, commitCachePassiveMountEffect, commitHookPassiveMountEffects, commitOffscreenPassiveMountEffects, commitTracingMarkerPassiveMountEffect, popComponentEffectDuration, popComponentEffectStart, popNestedEffectDurations, and 8 more.
What calls commitPassiveMountOnFiber()?
commitPassiveMountOnFiber() is called by 2 function(s): commitPassiveMountEffects, recursivelyTraversePassiveMountEffects.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free