Fix/add missing else branch for renders with no props change (#34837)
Stacked on https://github.com/facebook/react/pull/34822. Fixes a bug introduced in https://github.com/facebook/react/pull/34370. Just copying the lower else branch to the `properties.length` else branch at the top.
Ruslan Lesiutin committed
Oct 13, 2025 at 17:23 UTC
47905a79507f9ae5fc1bf633f7cbbd1894b9523b
2 files changed
+26
-1
packages/react-reconciler/src/ReactFiberPerformanceTrack.js
+24
@@ -305,6 +305,30 @@ export function logComponentRender(
305
} else {
306
performance.measure('\u200b' + name, reusableComponentOptions);
307
}
308
+ } else {
309
+ if (debugTask != null) {
310
+ debugTask.run(
311
+ // $FlowFixMe[method-unbinding]
312
+ console.timeStamp.bind(
313
+ console,
314
+ name,
315
+ startTime,
316
+ endTime,
317
+ COMPONENTS_TRACK,
318
+ undefined,
319
+ color,
320
+ ),
321
+ );
322
+ } else {
323
+ console.timeStamp(
324
+ name,
325
+ startTime,
326
+ endTime,
327
+ COMPONENTS_TRACK,
328
+ undefined,
329
+ color,
330
+ );
331
+ }
332
}
333
} else {
334
if (debugTask != null) {
packages/react-reconciler/src/__tests__/ReactPerformanceTrack-test.js
+2
-1
@@ -350,7 +350,7 @@ describe('ReactPerformanceTracks', () => {
350
});
351
352
// @gate __DEV__ && enableComponentPerformanceTrack
353
- it('includes spans for Components with no prop changes', async () => {
353
+ it('includes console.timeStamp spans for Components with no prop changes', async () => {
354
function Left({value}) {
355
Scheduler.unstable_advanceTime(5000);
356
}
@@ -436,6 +436,7 @@ describe('ReactPerformanceTracks', () => {
436
]);
437
expect(getConsoleTimestampEntries()).toEqual([
438
['Render', 16000, 31000, 'Blocking', 'Scheduler ⚛', 'primary-dark'],
439
+ ['Right', 21000, 31000, 'Components ⚛', undefined, 'error'],
440
]);
441
performanceMeasureCalls.length = 0;
442
});