mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Stringify context as SomeContext instead of SomeContext.Provider (#33507)
This matches the change in React 19 to use `<SomeContext>` as the preferred way to provide a context.
This commit is contained in:
@@ -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.',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user