-
Notifications
You must be signed in to change notification settings - Fork 832
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
Possible to export the props for given components for typescript #1666
Comments
Ok, I found out that I can get rid of the typescript error by adding three apparently required fields.
So the error is no longer a problem. It would still be handy to have the props be exported for extending. |
@JeffBaumgardt This issue seems to resonate with #1631. |
@JeffBaumgardt please provide your case. I cannot reproduce an error with |
I'm not sure why the focued was required. I tried several times yesterday and it was erroring out if I was missing, value, onChange and focused. Today, however focused is no longer needed. I'm unsure why. Oh well. Thanks for the types on the export. That will help 👍 |
https://github.com/mui-org/material-ui-pickers/blob/2323a4b3e4e8479909ad5a9de4a671320506360f/lib/src/DateRangePicker/DateRangePicker.tsx#L30
Would it be possible to export the prop interfaces so that I can use them in typescript.
Reason:
I am writing a wrapper for the DateRangePicker. I'm just wrapping things that I need on top of it but the component is having a hard time dealing with props that are just transfered.
I get a very ugly (and long) typescript error.
I believe if the interface was exported then I could import the props and use that to extend my type.
For obvious reasons you would also have to extend those interfaces for the DesktopDateRangePicker and MobileDateRangePicker. Not including other components that may want to also export the types.
I ask because this is how
@material-ui/core
exports the types for each of the components.The text was updated successfully, but these errors were encountered: