Using React.ComponentProps to extract prop types #3554
aaronfulkerson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that the team is exporting types but it took me a second to figure out. I was expecting to be able to use
React.ComponentProps<typeof Button>
which, surprisingly, works only because all props get set toany
. No errors in the IDE whatsoever.I'm sure the team is already aware of this behavior but I thought I'd bring it up anyways just to get an answer. Was there a conscious decision behind it or were there design choices made that prevent
React.ComponentProps
from working the way it's intended?Beta Was this translation helpful? Give feedback.
All reactions