MCPcopy Index your code
hub / github.com/caseywebdev/react-list / updateOffscreenComponent

Function updateOffscreenComponent

docs/index.js:9046–9103  ·  view source on GitHub ↗
(current, workInProgress, renderLanes)

Source from the content-addressed store, hash-verified

9044 );
9045}
9046function updateOffscreenComponent(current, workInProgress, renderLanes) {
9047 var nextProps = workInProgress.pendingProps,
9048 nextChildren = nextProps.children,
9049 nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2),
9050 prevState = null !== current ? current.memoizedState : null;
9051 markRef(current, workInProgress);
9052 if ("hidden" === nextProps.mode || nextIsDetached) {
9053 if (0 !== (workInProgress.flags & 128)) {
9054 nextProps =
9055 null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;
9056 if (null !== current) {
9057 nextChildren = workInProgress.child = current.child;
9058 for (nextIsDetached = 0; null !== nextChildren; )
9059 (nextIsDetached =
9060 nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
9061 (nextChildren = nextChildren.sibling);
9062 workInProgress.childLanes = nextIsDetached & ~nextProps;
9063 } else (workInProgress.childLanes = 0), (workInProgress.child = null);
9064 return deferHiddenOffscreenComponent(
9065 current,
9066 workInProgress,
9067 nextProps,
9068 renderLanes
9069 );
9070 }
9071 if (0 !== (renderLanes & 536870912))
9072 (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
9073 null !== current &&
9074 pushTransition(
9075 workInProgress,
9076 null !== prevState ? prevState.cachePool : null
9077 ),
9078 null !== prevState
9079 ? pushHiddenContext(workInProgress, prevState)
9080 : reuseHiddenContextOnStack(),
9081 pushOffscreenSuspenseHandler(workInProgress);
9082 else
9083 return (
9084 (workInProgress.lanes = workInProgress.childLanes = 536870912),
9085 deferHiddenOffscreenComponent(
9086 current,
9087 workInProgress,
9088 null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
9089 renderLanes
9090 )
9091 );
9092 } else
9093 null !== prevState
9094 ? (pushTransition(workInProgress, prevState.cachePool),
9095 pushHiddenContext(workInProgress, prevState),
9096 reuseSuspenseHandlerOnStack(workInProgress),
9097 (workInProgress.memoizedState = null))
9098 : (null !== current && pushTransition(workInProgress, null),
9099 reuseHiddenContextOnStack(),
9100 reuseSuspenseHandlerOnStack(workInProgress));
9101 reconcileChildren(current, workInProgress, nextChildren, renderLanes);
9102 return workInProgress.child;
9103}

Callers 2

beginWorkFunction · 0.85

Calls 8

markRefFunction · 0.85
pushTransitionFunction · 0.85
pushHiddenContextFunction · 0.85
reconcileChildrenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…