mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +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:
1 parent
1d6c8168db
commit
39cad7afc4
1 file changed
+11
-23
+11
-23
@@ -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