GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Include actual type of `Profiler#id` on type mismatch (#20306) · react/react@75c6165

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-reconciler/src
      • ReactFiber.new.js
      • ReactFiber.old.js
    • react/src/__tests__
      • ReactProfiler-test.internal.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiber.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.new.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,10 @@ function createFiberFromProfiler(
651651
): Fiber {
652652
if (__DEV__) {
653653
if (typeof pendingProps.id !== 'string') {
654-
console.error('Profiler must specify an "id" as a prop');
654+
console.error(
655+
'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',
656+
typeof pendingProps.id,
657+
);
655658
}
656659
}
657660

Collapse file

‎packages/react-reconciler/src/ReactFiber.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.old.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,10 @@ function createFiberFromProfiler(
651651
): Fiber {
652652
if (__DEV__) {
653653
if (typeof pendingProps.id !== 'string') {
654-
console.error('Profiler must specify an "id" as a prop');
654+
console.error(
655+
'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',
656+
typeof pendingProps.id,
657+
);
655658
}
656659
}
657660

Collapse file

‎packages/react/src/__tests__/ReactProfiler-test.internal.js‎

Copy file name to clipboardExpand all lines: packages/react/src/__tests__/ReactProfiler-test.internal.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,12 @@ describe('Profiler', () => {
136136
it('should warn if required params are missing', () => {
137137
expect(() => {
138138
ReactTestRenderer.create(<React.Profiler />);
139-
}).toErrorDev('Profiler must specify an "id" as a prop', {
140-
withoutStack: true,
141-
});
139+
}).toErrorDev(
140+
'Profiler must specify an "id" of type `string` as a prop. Received the type `undefined` instead.',
141+
{
142+
withoutStack: true,
143+
},
144+
);
142145
});
143146
}
144147

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.