react-shimmer icon indicating copy to clipboard operation
react-shimmer copied to clipboard

Typescript support?

Open ernestdodz opened this issue 2 years ago • 4 comments

image I wanna try but got this problem. 'Image' cannot be used as a JSX component. Its instance type 'SuspenseImage' is not a valid JSX element. The types returned by 'render()' are incompatible between these types. Type '{} | null | undefined' is not assignable to type 'ReactNode'. Type '{}' is not assignable to type 'ReactNode'.

I am using latest react with nextjs.

ernestdodz avatar Aug 04 '22 02:08 ernestdodz

I think this is issue with react 18, as the plugin is not updated yet.

ernestdodz avatar Aug 20 '22 04:08 ernestdodz

Hi, which version of React is this example from? Do you have a specific example with CodeSandbox/Replit etc link?

gokcan avatar Apr 10 '23 00:04 gokcan

Same problem under react-17.0.2

Its type 'typeof SuspenseImage' is not a valid JSX element type

babyfish-ct avatar Jul 29 '23 22:07 babyfish-ct

Now, I'm using the workaround

const ImageForTs = Image as any as React.ComponentClass<ImageProps>;

babyfish-ct avatar Jul 29 '23 22:07 babyfish-ct