mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Remove redundant __DEV__ condition (#32810)
It used to be that in `__DEV__` we wrapped this `renderWithHooks`, `checkDidRenderIdHook` pair in calls to `setIsRendering()`. However, that dev-only bookkeeping was removed in https://github.com/facebook/react/pull/29206 leaving this redundant check which runs identical code in dev and in prod. ## Test Plan * Manually confirm both cases are the same * GitHub CI tests
This commit is contained in:
@@ -436,33 +436,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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user