@samitouri / QOS-React-2 / commits / 39cad7afc4

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

Jordan Eldredge committed Apr 11, 2025 at 14:39 UTC 39cad7afc43fcbca1fd2e3a0d5b7706c8b237793
1 file changed +11 -23
packages/react-reconciler/src/ReactFiberBeginWork.js
+11 -23
@@ -436,33 +436,21 @@ function updateForwardRef(
436 }
437
438 // The rest is a fork of updateFunctionComponent
439 - let nextChildren;
440 - let hasId;
439 prepareToReadContext(workInProgress, renderLanes);
440 if (enableSchedulingProfiler) {
441 markComponentRenderStarted(workInProgress);
442 }
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 +
454 if (enableSchedulingProfiler) {
455 markComponentRenderStopped();
456 }