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

Function ReactFiberBeginWork

code/new-context-api/public/app.js:9095–9907  ·  view source on GitHub ↗
(config, hostContext, legacyContext, newContext, hydrationContext, scheduleWork, computeExpirationForFiber)

Source from the content-addressed store, hash-verified

9093}
9094
9095var ReactFiberBeginWork = function (config, hostContext, legacyContext, newContext, hydrationContext, scheduleWork, computeExpirationForFiber) {
9096 var shouldSetTextContent = config.shouldSetTextContent,
9097 shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree;
9098 var pushHostContext = hostContext.pushHostContext,
9099 pushHostContainer = hostContext.pushHostContainer;
9100 var pushProvider = newContext.pushProvider;
9101 var getMaskedContext = legacyContext.getMaskedContext,
9102 getUnmaskedContext = legacyContext.getUnmaskedContext,
9103 hasLegacyContextChanged = legacyContext.hasContextChanged,
9104 pushLegacyContextProvider = legacyContext.pushContextProvider,
9105 pushTopLevelContextObject = legacyContext.pushTopLevelContextObject,
9106 invalidateContextProvider = legacyContext.invalidateContextProvider;
9107 var enterHydrationState = hydrationContext.enterHydrationState,
9108 resetHydrationState = hydrationContext.resetHydrationState,
9109 tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance;
9110
9111 var _ReactFiberClassCompo = ReactFiberClassComponent(legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState),
9112 adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance,
9113 callGetDerivedStateFromProps = _ReactFiberClassCompo.callGetDerivedStateFromProps,
9114 constructClassInstance = _ReactFiberClassCompo.constructClassInstance,
9115 mountClassInstance = _ReactFiberClassCompo.mountClassInstance,
9116 resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance,
9117 updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
9118
9119 // TODO: Remove this and use reconcileChildrenAtExpirationTime directly.
9120
9121
9122 function reconcileChildren(current, workInProgress, nextChildren) {
9123 reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, workInProgress.expirationTime);
9124 }
9125
9126 function reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime) {
9127 if (current === null) {
9128 // If this is a fresh new component that hasn't been rendered yet, we
9129 // won't update its child set by applying minimal side-effects. Instead,
9130 // we will add them all to the child before it gets rendered. That means
9131 // we can optimize this reconciliation pass by not tracking side-effects.
9132 workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
9133 } else {
9134 // If the current child is the same as the work in progress, it means that
9135 // we haven't yet started any work on these children. Therefore, we use
9136 // the clone algorithm to create a copy of all the current children.
9137
9138 // If we had any progressed work already, that is invalid at this point so
9139 // let's throw it out.
9140 workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);
9141 }
9142 }
9143
9144 function updateForwardRef(current, workInProgress) {
9145 var render = workInProgress.type.render;
9146 var nextChildren = render(workInProgress.pendingProps, workInProgress.ref);
9147 reconcileChildren(current, workInProgress, nextChildren);
9148 memoizeProps(workInProgress, nextChildren);
9149 return workInProgress.child;
9150 }
9151
9152 function updateFragment(current, workInProgress) {

Callers 1

ReactFiberSchedulerFunction · 0.70

Calls 1

ReactFiberClassComponentFunction · 0.70

Tested by

no test coverage detected