-
Notifications
You must be signed in to change notification settings - Fork 38
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
Typescript error on React 18 (Property 'children' does not exist on type) #130
Comments
I am facing the same issues. It seems like the library is not ready to support react v18 yet. One of teh workaround I did is create a type declaration file import { ReactNode } from 'react';
import { TooltipProps as Props } from 'react-tooltip-lite';
declare module 'react-tooltip-lite' {
export interface TooltipProps extends Props {
children: ReactNode;
}
} |
Thanks for your workaround, I have a similar problem with another library, this should be a good solution for now. Since the library is not supported react v18 yet. |
this workaround produces an erorr :( |
I found out that in new typescript versions you just need to export a TooltipProps without extending it like so: import { ReactNode } from 'react';
declare module 'react-tooltip-lite' {
export interface TooltipProps {
children: ReactNode;
}
} |
Typescript complains once you update to React 18, because
children
now have to be listed explicitely on component props.The error is this:
My code:
The text was updated successfully, but these errors were encountered: