Skip to content

Commit 8c247a2

Browse files
committed
Remove redundant __DEV__ condition
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 facebook#29206 leaving this redundant check which runs identical code in dev and in prod.
1 parent f0c767e commit 8c247a2

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
@@ -433,33 +433,21 @@ function updateForwardRef(
433433
}
434434

435435
// The rest is a fork of updateFunctionComponent
436-
let nextChildren;
437-
let hasId;
438436
prepareToReadContext(workInProgress, renderLanes);
439437
if (enableSchedulingProfiler) {
440438
markComponentRenderStarted(workInProgress);
441439
}
442-
if (__DEV__) {
443-
nextChildren = renderWithHooks(
444-
current,
445-
workInProgress,
446-
render,
447-
propsWithoutRef,
448-
ref,
449-
renderLanes,
450-
);
451-
hasId = checkDidRenderIdHook();
452-
} else {
453-
nextChildren = renderWithHooks(
454-
current,
455-
workInProgress,
456-
render,
457-
propsWithoutRef,
458-
ref,
459-
renderLanes,
460-
);
461-
hasId = checkDidRenderIdHook();
462-
}
440+
441+
const nextChildren = renderWithHooks(
442+
current,
443+
workInProgress,
444+
render,
445+
propsWithoutRef,
446+
ref,
447+
renderLanes,
448+
);
449+
const hasId = checkDidRenderIdHook();
450+
463451
if (enableSchedulingProfiler) {
464452
markComponentRenderStopped();
465453
}

0 commit comments

Comments
 (0)