wellyshen / react-cool-img

😎 🏞 A React <Img /> component let you handle image UX and performance as a Pro!
https://react-cool-img.netlify.app
MIT License
778 stars 29 forks source link

<Img/> is `any` type because of wrong type definition #983

Open tkamenoko opened 2 years ago

tkamenoko commented 2 years ago

Bug Report

Describe the Bug

Img element is any type that prevents auto completion.

Expected Behavior

Img should have a valid type definition.

Screenshots

vscode

Your Environment

Additional Information

Here is Img 's definition:

https://github.com/wellyshen/react-cool-img/blob/ff528a8d14281167d7f48662dad38c2cc33b9b6d/src/react-cool-img.d.ts#L45

But react.ForwardRefExoticComponent accepts only one type argument.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/72c1299e1ad143a84b900f7435c8b9f5f04a1d3e/types/react/index.d.ts#L773-L778

TrejoCode commented 2 years ago

I think the same

wellyshen commented 1 year ago

@tkamenoko What are your React and TS versions?