diff --git a/packages/react-reconciler/src/ReactDebugFiberPerf.js b/packages/react-reconciler/src/ReactDebugFiberPerf.js index ba238c49d1e9a..cc5dfc9ef6c00 100644 --- a/packages/react-reconciler/src/ReactDebugFiberPerf.js +++ b/packages/react-reconciler/src/ReactDebugFiberPerf.js @@ -121,8 +121,7 @@ const getFiberLabel = ( const getFiberName = (fiber: Fiber): string | null => { if (fiber.tag === SimpleMemoComponent) { - const innerName = getComponentName(fiber.type); - return `Memo${innerName !== null ? `(${innerName})` : ''}`; + return getComponentName(fiber.elementType); } return getComponentName(fiber.type); diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js b/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js index 2474c58cfa4e2..ca5506965c72b 100644 --- a/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js +++ b/packages/react-reconciler/src/__tests__/ReactIncrementalPerf-test.internal.js @@ -573,9 +573,14 @@ describe('ReactDebugFiberPerf', () => { const MemoFoo = React.memo(function Foo() { return
; }); + const MemoBar = React.memo(function Bar() { + return ; + }); + MemoBar.displayName = 'NamedBar'; ReactNoop.render( + , ); expect(Scheduler).toFlushWithoutYielding(); diff --git a/packages/react-reconciler/src/__tests__/__snapshots__/ReactIncrementalPerf-test.internal.js.snap b/packages/react-reconciler/src/__tests__/__snapshots__/ReactIncrementalPerf-test.internal.js.snap index a3ff5fe60eaca..b195bf49a1f79 100644 --- a/packages/react-reconciler/src/__tests__/__snapshots__/ReactIncrementalPerf-test.internal.js.snap +++ b/packages/react-reconciler/src/__tests__/__snapshots__/ReactIncrementalPerf-test.internal.js.snap @@ -380,6 +380,7 @@ exports[`ReactDebugFiberPerf supports memo 1`] = ` "⚛ (React Tree Reconciliation: Completed Root) ⚛ Parent [mount] ⚛ Memo(Foo) [mount] + ⚛ NamedBar [mount] ⚛ (Committing Changes) ⚛ (Committing Snapshot Effects: 0 Total)