react-icalendar-link
react-icalendar-link copied to clipboard
React 18 incompatible?
I get the error
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ICalLink> & Pick<Readonly<Props>, never> & InexactPartial<...> & InexactPartial<...>'.
is it because of this?
same here
Any solution?
You can update the interface to make it work:
- Create the file:
src/types/react-icalendar-link/index.d.tsand type:
import { PropsWithChildren } from 'react';
import ICalendarLink from 'react-icalendar-link';
declare module 'react-icalendar-link' {
const ICalLink: typeof PropsWithChildren<ICalendarLink>;
export default ICalLink;
}
- In your
tsconfig.json:
{
...,
"compilerOptions": {
...,
"paths": {
...,
"react-icalendar-link": ["src/types/react-icalendar-link"],
}
},
}