Skip to content

fix: @types/react 17 PropsWithChildren Generic type#356

Merged
pacocoursey merged 1 commit intopacocoursey:mainfrom
eliot-liner:patch-2
May 31, 2025
Merged

fix: @types/react 17 PropsWithChildren Generic type#356
pacocoursey merged 1 commit intopacocoursey:mainfrom
eliot-liner:patch-2

Conversation

@eliot-liner
Copy link
Contributor

@eliot-liner eliot-liner commented May 11, 2025

An TypeScript error occurred in React 17.

Type '{ children: ReactNode; }' has no properties in common with type 'IntrinsicAttributes & ThemeProviderProps'.

When I checked

"@types/react": "18.0.12"

  • type PropsWithChildren<P = unknown> = P & { children?: ReactNode | undefined };

"@types/react": "17.0.34"

  • type PropsWithChildren<P> = P & { children?: ReactNode | undefined };

So, to support React 17 version, we need to add Generic. Currently, we have no choice but to use ts-ignore because it always causes a type error.

@pacocoursey pacocoursey merged commit a7eeabc into pacocoursey:main May 31, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants