Skip to content
Closed
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
68 changes: 22 additions & 46 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,33 +430,21 @@ function updateForwardRef(
}

// The rest is a fork of updateFunctionComponent
let nextChildren;
let hasId;
prepareToReadContext(workInProgress, renderLanes);
if (enableSchedulingProfiler) {
markComponentRenderStarted(workInProgress);
}
if (__DEV__) {
nextChildren = renderWithHooks(
current,
workInProgress,
render,
propsWithoutRef,
ref,
renderLanes,
);
hasId = checkDidRenderIdHook();
} else {
nextChildren = renderWithHooks(
current,
workInProgress,
render,
propsWithoutRef,
ref,
renderLanes,
);
hasId = checkDidRenderIdHook();
}

const nextChildren = renderWithHooks(
current,
workInProgress,
render,
propsWithoutRef,
ref,
renderLanes,
);
const hasId = checkDidRenderIdHook();

if (enableSchedulingProfiler) {
markComponentRenderStopped();
}
Expand Down Expand Up @@ -1133,33 +1121,21 @@ 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