Skip to content
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

[docs] Add Pickers TypeScript demos #15103

Merged
merged 1 commit into from
Mar 30, 2019

Conversation

sperry94
Copy link
Contributor

Adding TS demos for Picker components as a part of issue #14897

@mui-pr-bot
Copy link

No bundle size changes comparing 264c64d...2e1ded3

Generated by 🚫 dangerJS against 2e1ded3

@oliviertassinari oliviertassinari changed the title [docs] Adding Pickers Typescript demos [docs] Add Pickers Typescript demos Mar 29, 2019
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Mar 29, 2019
@oliviertassinari oliviertassinari changed the title [docs] Add Pickers Typescript demos [docs] Add Pickers TypeScript demos Mar 30, 2019
@oliviertassinari oliviertassinari merged commit 39634f5 into mui:next Mar 30, 2019
export type Props = WithStyles<typeof styles>;

export interface State {
selectedDate: any;
Copy link
Member

@eps1lon eps1lon Mar 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sperry94 Why was the any necessary here? Is there maybe some fix we can propose upstream to material-ui-pickers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eps1lon Looks like their typing for date is really just an alias for any

material-ui-pickers date typing file:
date.ts

Created issue mui/material-ui-pickers#970

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep an eye on it. I think we should use an actual type here. If we use the correct one an update in material-ui-pickers is fine. If not we get notified with a test failure on update.

Copy link
Member

@dmtrKovalenko dmtrKovalenko Apr 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fill free to use Date type here.
In pickers we can provide only Moment | Luxon | Date | Dayjs. That’s one of points that we will change in v3.

But you are using date-fns utility, so you will never get the other types in onChange.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eps1lon agreed. I made PR #15144 to use the Date type in this demo.

@dmtrKovalenko thank you for your help!

@sperry94 sperry94 deleted the ts-docs-pickers branch March 30, 2019 22:34
@eps1lon eps1lon mentioned this pull request Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants