MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / ReactFiberBeginWork

Function ReactFiberBeginWork

code/composition/public/app.js:9872–10684  ·  view source on GitHub ↗
(config, hostContext, legacyContext, newContext, hydrationContext, scheduleWork, computeExpirationForFiber)

Source from the content-addressed store, hash-verified

9870}
9871
9872var ReactFiberBeginWork = function (config, hostContext, legacyContext, newContext, hydrationContext, scheduleWork, computeExpirationForFiber) {
9873 var shouldSetTextContent = config.shouldSetTextContent,
9874 shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree;
9875 var pushHostContext = hostContext.pushHostContext,
9876 pushHostContainer = hostContext.pushHostContainer;
9877 var pushProvider = newContext.pushProvider;
9878 var getMaskedContext = legacyContext.getMaskedContext,
9879 getUnmaskedContext = legacyContext.getUnmaskedContext,
9880 hasLegacyContextChanged = legacyContext.hasContextChanged,
9881 pushLegacyContextProvider = legacyContext.pushContextProvider,
9882 pushTopLevelContextObject = legacyContext.pushTopLevelContextObject,
9883 invalidateContextProvider = legacyContext.invalidateContextProvider;
9884 var enterHydrationState = hydrationContext.enterHydrationState,
9885 resetHydrationState = hydrationContext.resetHydrationState,
9886 tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance;
9887
9888 var _ReactFiberClassCompo = ReactFiberClassComponent(legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState),
9889 adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance,
9890 callGetDerivedStateFromProps = _ReactFiberClassCompo.callGetDerivedStateFromProps,
9891 constructClassInstance = _ReactFiberClassCompo.constructClassInstance,
9892 mountClassInstance = _ReactFiberClassCompo.mountClassInstance,
9893 resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance,
9894 updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
9895
9896 // TODO: Remove this and use reconcileChildrenAtExpirationTime directly.
9897
9898
9899 function reconcileChildren(current, workInProgress, nextChildren) {
9900 reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, workInProgress.expirationTime);
9901 }
9902
9903 function reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime) {
9904 if (current === null) {
9905 // If this is a fresh new component that hasn't been rendered yet, we
9906 // won't update its child set by applying minimal side-effects. Instead,
9907 // we will add them all to the child before it gets rendered. That means
9908 // we can optimize this reconciliation pass by not tracking side-effects.
9909 workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
9910 } else {
9911 // If the current child is the same as the work in progress, it means that
9912 // we haven't yet started any work on these children. Therefore, we use
9913 // the clone algorithm to create a copy of all the current children.
9914
9915 // If we had any progressed work already, that is invalid at this point so
9916 // let's throw it out.
9917 workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);
9918 }
9919 }
9920
9921 function updateForwardRef(current, workInProgress) {
9922 var render = workInProgress.type.render;
9923 var nextChildren = render(workInProgress.pendingProps, workInProgress.ref);
9924 reconcileChildren(current, workInProgress, nextChildren);
9925 memoizeProps(workInProgress, nextChildren);
9926 return workInProgress.child;
9927 }
9928
9929 function updateFragment(current, workInProgress) {

Callers 1

ReactFiberSchedulerFunction · 0.70

Calls 1

ReactFiberClassComponentFunction · 0.70

Tested by

no test coverage detected