Open magnattic opened 2 years ago
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 index.d.ts
with the following code to overwrite the type.
import { ReactNode } from 'react';
import { TooltipProps as Props } from 'react-tooltip-lite';
declare module 'react-tooltip-lite' {
export interface TooltipProps extends Props {
children: ReactNode;
}
}
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
index.d.ts
with the following code to overwrite the type.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.
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
index.d.ts
with the following code to overwrite the type.import { ReactNode } from 'react'; import { TooltipProps as Props } from 'react-tooltip-lite'; declare module 'react-tooltip-lite' { export interface TooltipProps extends Props { children: ReactNode; } }
this workaround produces an erorr :( Type error: Type 'TooltipProps' recursively references itself as a base type.
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
index.d.ts
with the following code to overwrite the type.import { ReactNode } from 'react'; import { TooltipProps as Props } from 'react-tooltip-lite'; declare module 'react-tooltip-lite' { export interface TooltipProps extends Props { children: ReactNode; } }
this workaround produces an erorr :( Type error: Type 'TooltipProps' recursively references itself as a base type.
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: