-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types for components #646
Types for components #646
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pasalietis awesome work kicking this off!
We'll want to include types via package.json – something like this:
https://github.com/segmentio/evergreen/blob/typescript/package.json#L25
I'm going to hold off on more comments because I think we can very quickly evolve this once it lands.
OptionsList SelectMenuContent Table TableHead TableHeaderCell TextTableHeaderCell SearchTableHeaderCell TableBody TableRow TableCell TextTableCell
export class Autocomplete extends React.PureComponent<AutocompleteProps> { | ||
} | ||
|
||
export interface AvatarProps extends BoxProps<'div'> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right as a starting point. I think it'll produce the wrong type for when you pass a custom is
value, but for that to work we'd need to do something like React.ComponentProps<typeof Box>
but I've tried that and it won't play nicely with the prop generic inference we have going on with is
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure we include the file path for these types in the package.json
?
…types � Conflicts: � .gitignore
do you mean just add |
@mshwery @Pasalietis anything I can do to help this along? I've been improving my local typings and will contribute my edits as soon as this is up! |
I need help with setting types in package.json |
Thanks so much for pushing this through everyone, makes the library much more usable! |
This is types for components only. So there is missing types for theme and etc
Also list of components with props = Record<string, any>
Todo: