Skip to content

Stringify context as SomeContext instead of SomeContext.Provider #33507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ describe('ReactLazy', () => {
</Suspense>,
);
await waitForThrow(
'Element type is invalid. Received a promise that resolves to: Context.Provider. ' +
'Element type is invalid. Received a promise that resolves to: Context. ' +
'Lazy element type must resolve to a class or function.',
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/getComponentNameFromFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function getComponentNameFromFiber(fiber: Fiber): string | null {
return getContextName(consumer._context) + '.Consumer';
case ContextProvider:
const context: ReactContext<any> = (type: any);
return getContextName(context) + '.Provider';
return getContextName(context);
case DehydratedFragment:
return 'DehydratedFragment';
case ForwardRef:
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/getComponentNameFromType.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function getComponentNameFromType(type: mixed): string | null {
return 'Portal';
case REACT_CONTEXT_TYPE:
const context: ReactContext<any> = (type: any);
return getContextName(context) + '.Provider';
return getContextName(context);
case REACT_CONSUMER_TYPE:
const consumer: ReactConsumerType<any> = (type: any);
return getContextName(consumer._context) + '.Consumer';
Expand Down
Loading