You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
Obviously, the examples are kind of useless, but for large components that spread certain props into html elements it would be very useful to be able to declare prop types for those props.
Thank you!
The text was updated successfully, but these errors were encountered:
That would be a massive effort to maintain, since the list of valid attributes per html element changes all the time. (Separately, it’s generally considered a bad practice to spread props onto html elements - favor explicit over implicit)
It’s certainly possible, but there’s so many html elements with so large and complex lists of attributes and attribute value validations that it’s probably best done as a separate project.
That makes sense, however I assumed react already has somewhat of a list somewhere since vscode already provides really nice autocomplete when typing plain elements in react.
Do you know where this list comes from?
I'll take into account your suggestion not to spread props into html elements. That actually sounds like a better solution. Thanks
Is there a way to add proptypes for plain react (HTML) elements, in a way similar to this?
Or even better, to simply spread those props into the prop types like this:
Obviously, the examples are kind of useless, but for large components that spread certain props into html elements it would be very useful to be able to declare prop types for those props.
Thank you!
The text was updated successfully, but these errors were encountered: