diff --git a/packages/react-reconciler/src/ReactFiber.new.js b/packages/react-reconciler/src/ReactFiber.new.js index 5426568b96611..4e5316130dd85 100644 --- a/packages/react-reconciler/src/ReactFiber.new.js +++ b/packages/react-reconciler/src/ReactFiber.new.js @@ -650,7 +650,10 @@ function createFiberFromProfiler( ): Fiber { if (__DEV__) { if (typeof pendingProps.id !== 'string') { - console.error('Profiler must specify an "id" as a prop'); + console.error( + 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', + typeof pendingProps.id, + ); } } diff --git a/packages/react-reconciler/src/ReactFiber.old.js b/packages/react-reconciler/src/ReactFiber.old.js index 56ef2f5a528ab..5bebd9626762c 100644 --- a/packages/react-reconciler/src/ReactFiber.old.js +++ b/packages/react-reconciler/src/ReactFiber.old.js @@ -650,7 +650,10 @@ function createFiberFromProfiler( ): Fiber { if (__DEV__) { if (typeof pendingProps.id !== 'string') { - console.error('Profiler must specify an "id" as a prop'); + console.error( + 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', + typeof pendingProps.id, + ); } } diff --git a/packages/react/src/__tests__/ReactProfiler-test.internal.js b/packages/react/src/__tests__/ReactProfiler-test.internal.js index 9089bfb1cabab..c0e41bd735c15 100644 --- a/packages/react/src/__tests__/ReactProfiler-test.internal.js +++ b/packages/react/src/__tests__/ReactProfiler-test.internal.js @@ -136,9 +136,12 @@ describe('Profiler', () => { it('should warn if required params are missing', () => { expect(() => { ReactTestRenderer.create(); - }).toErrorDev('Profiler must specify an "id" as a prop', { - withoutStack: true, - }); + }).toErrorDev( + 'Profiler must specify an "id" of type `string` as a prop. Received the type `undefined` instead.', + { + withoutStack: true, + }, + ); }); }