MCPcopy Create free account
hub / github.com/BetaSu/big-react / updateFunctionComponent

Function updateFunctionComponent

packages/react-reconciler/src/beginWork.ts:217–234  ·  view source on GitHub ↗
(
	wip: FiberNode,
	Component: FiberNode['type'],
	renderLane: Lane
)

Source from the content-addressed store, hash-verified

215}
216
217function updateFunctionComponent(
218 wip: FiberNode,
219 Component: FiberNode['type'],
220 renderLane: Lane
221) {
222 prepareToReadContext(wip, renderLane);
223 // render
224 const nextChildren = renderWithHooks(wip, Component, renderLane);
225
226 const current = wip.alternate;
227 if (current !== null && !didReceiveUpdate) {
228 bailoutHook(wip, renderLane);
229 return bailoutOnAlreadyFinishedWork(wip, renderLane);
230 }
231
232 reconcileChildren(wip, nextChildren);
233 return wip.child;
234}
235
236function updateHostRoot(wip: FiberNode, renderLane: Lane) {
237 const baseState = wip.memoizedState;

Callers 3

beginWorkFunction · 0.85
mountLazyComponentFunction · 0.85
updateMemoComponentFunction · 0.85

Calls 5

prepareToReadContextFunction · 0.90
renderWithHooksFunction · 0.90
bailoutHookFunction · 0.90
reconcileChildrenFunction · 0.85

Tested by

no test coverage detected