Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 9 additions & 23 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -1474,33 +1474,19 @@ function updateFunctionComponent(
context = getMaskedContext(workInProgress, unmaskedContext);
}

let nextChildren;
let hasId;
prepareToReadContext(workInProgress, renderLanes);
if (enableSchedulingProfiler) {
markComponentRenderStarted(workInProgress);
}
if (__DEV__) {
nextChildren = renderWithHooks(
current,
workInProgress,
Component,
nextProps,
context,
renderLanes,
);
hasId = checkDidRenderIdHook();
} else {
nextChildren = renderWithHooks(
current,
workInProgress,
Component,
nextProps,
context,
renderLanes,
);
hasId = checkDidRenderIdHook();
}
const nextChildren = renderWithHooks(
current,
workInProgress,
Component,
nextProps,
context,
renderLanes,
);
const hasId = checkDidRenderIdHook();
if (enableSchedulingProfiler) {
markComponentRenderStopped();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function markUpdateLaneFromFiberToRoot(
}

function getRootForUpdatedFiber(sourceFiber: Fiber): FiberRoot | null {
// TODO: We will detect and infinite update loop and throw even if this fiber
// TODO: We will detect an infinite update loop and throw even if this fiber
// has already unmounted. This isn't really necessary but it happens to be the
// current behavior we've used for several release cycles. Consider not
// performing this check if the updated fiber already unmounted, since it's
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ export function renderWithHooks<Props, SecondArg>(
//
// We want memoized functions to run twice, too, so account for this, user
// functions are double invoked during the *first* invocation of the component
// function, and are *not* double invoked during the second incovation:
// function, and are *not* double invoked during the second invocation:
//
// - First execution of component function: user functions are double invoked
// - Second execution of component function (in Strict Mode, during
Expand Down