react-icalendar-link icon indicating copy to clipboard operation
react-icalendar-link copied to clipboard

React 18 incompatible?

Open hundehausen opened this issue 3 years ago • 3 comments

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?

hundehausen avatar Sep 23 '22 11:09 hundehausen

same here

longgtruong avatar Apr 02 '23 20:04 longgtruong

Any solution?

Knighton910 avatar Jun 06 '23 18:06 Knighton910

You can update the interface to make it work:

  • Create the file: src/types/react-icalendar-link/index.d.ts and 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"],
    }
  },
}

AntoLC avatar Jun 09 '23 08:06 AntoLC