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

Function updateFunctionalComponent

code/composition/public/app.js:9963–9994  ·  view source on GitHub ↗
(current, workInProgress)

Source from the content-addressed store, hash-verified

9961 }
9962
9963 function updateFunctionalComponent(current, workInProgress) {
9964 var fn = workInProgress.type;
9965 var nextProps = workInProgress.pendingProps;
9966
9967 if (hasLegacyContextChanged()) {
9968 // Normally we can bail out on props equality but if context has changed
9969 // we don't do the bailout and we have to reuse existing props instead.
9970 } else {
9971 if (workInProgress.memoizedProps === nextProps) {
9972 return bailoutOnAlreadyFinishedWork(current, workInProgress);
9973 }
9974 // TODO: consider bringing fn.shouldComponentUpdate() back.
9975 // It used to be here.
9976 }
9977
9978 var unmaskedContext = getUnmaskedContext(workInProgress);
9979 var context = getMaskedContext(workInProgress, unmaskedContext);
9980
9981 var nextChildren = void 0;
9982
9983 {
9984 ReactCurrentOwner.current = workInProgress;
9985 ReactDebugCurrentFiber.setCurrentPhase('render');
9986 nextChildren = fn(nextProps, context);
9987 ReactDebugCurrentFiber.setCurrentPhase(null);
9988 }
9989 // React DevTools reads this flag.
9990 workInProgress.effectTag |= PerformedWork;
9991 reconcileChildren(current, workInProgress, nextChildren);
9992 memoizeProps(workInProgress, nextProps);
9993 return workInProgress.child;
9994 }
9995
9996 function updateClassComponent(current, workInProgress, renderExpirationTime) {
9997 // 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