react-shimmer
react-shimmer copied to clipboard
Typescript support?
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.
I think this is issue with react 18, as the plugin is not updated yet.
Hi, which version of React is this example from? Do you have a specific example with CodeSandbox/Replit etc link?
Same problem under react-17.0.2
Its type 'typeof SuspenseImage' is not a valid JSX element type
Now, I'm using the workaround
const ImageForTs = Image as any as React.ComponentClass<ImageProps>;