Skip to content

Commit 39cad7a

Browse files
authored
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 #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
1 parent 1d6c816 commit 39cad7a

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -436,33 +436,21 @@ function updateForwardRef(
436436
}
437437

438438
// The rest is a fork of updateFunctionComponent
439-
let nextChildren;
440-
let hasId;
441439
prepareToReadContext(workInProgress, renderLanes);
442440
if (enableSchedulingProfiler) {
443441
markComponentRenderStarted(workInProgress);
444442
}
445-
if (__DEV__) {
446-
nextChildren = renderWithHooks(
447-
current,
448-
workInProgress,
449-
render,
450-
propsWithoutRef,
451-
ref,
452-
renderLanes,
453-
);
454-
hasId = checkDidRenderIdHook();
455-
} else {
456-
nextChildren = renderWithHooks(
457-
current,
458-
workInProgress,
459-
render,
460-
propsWithoutRef,
461-
ref,
462-
renderLanes,
463-
);
464-
hasId = checkDidRenderIdHook();
465-
}
443+
444+
const nextChildren = renderWithHooks(
445+
current,
446+
workInProgress,
447+
render,
448+
propsWithoutRef,
449+
ref,
450+
renderLanes,
451+
);
452+
const hasId = checkDidRenderIdHook();
453+
466454
if (enableSchedulingProfiler) {
467455
markComponentRenderStopped();
468456
}

0 commit comments

Comments
 (0)