MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / updateFunctionalComponent

Function updateFunctionalComponent

code/communication/public/app.js:9860–9891  ·  view source on GitHub ↗
(current, workInProgress)

Source from the content-addressed store, hash-verified

9858 }
9859
9860 function updateFunctionalComponent(current, workInProgress) {
9861 var fn = workInProgress.type;
9862 var nextProps = workInProgress.pendingProps;
9863
9864 if (hasLegacyContextChanged()) {
9865 // Normally we can bail out on props equality but if context has changed
9866 // we don't do the bailout and we have to reuse existing props instead.
9867 } else {
9868 if (workInProgress.memoizedProps === nextProps) {
9869 return bailoutOnAlreadyFinishedWork(current, workInProgress);
9870 }
9871 // TODO: consider bringing fn.shouldComponentUpdate() back.
9872 // It used to be here.
9873 }
9874
9875 var unmaskedContext = getUnmaskedContext(workInProgress);
9876 var context = getMaskedContext(workInProgress, unmaskedContext);
9877
9878 var nextChildren = void 0;
9879
9880 {
9881 ReactCurrentOwner.current = workInProgress;
9882 ReactDebugCurrentFiber.setCurrentPhase('render');
9883 nextChildren = fn(nextProps, context);
9884 ReactDebugCurrentFiber.setCurrentPhase(null);
9885 }
9886 // React DevTools reads this flag.
9887 workInProgress.effectTag |= PerformedWork;
9888 reconcileChildren(current, workInProgress, nextChildren);
9889 memoizeProps(workInProgress, nextProps);
9890 return workInProgress.child;
9891 }
9892
9893 function updateClassComponent(current, workInProgress, renderExpirationTime) {
9894 // Push context providers early to prevent context stack mismatches.

Callers 1

beginWorkFunction · 0.70

Calls 5

getUnmaskedContextFunction · 0.70
getMaskedContextFunction · 0.70
reconcileChildrenFunction · 0.70
memoizePropsFunction · 0.70

Tested by

no test coverage detected