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 CustomizedSwitches TypeScript demo #15424

Merged
merged 5 commits into from
Apr 22, 2019

Conversation

donigianrp
Copy link
Contributor

@donigianrp donigianrp commented Apr 20, 2019

#14897

@donigianrp donigianrp changed the title [docs] Add Customized switches ts demo [docs] Add CustomizedSwitches TypeScript demo Apr 20, 2019
@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation typescript labels Apr 20, 2019
@mui-pr-bot
Copy link

mui-pr-bot commented Apr 20, 2019

No bundle size changes comparing bdaadb5...991cbd4

Generated by 🚫 dangerJS against 991cbd4

@eps1lon eps1lon mentioned this pull request Apr 20, 2019
},
checked: {},
focusVisible: {},
}))(({ classes, ...props }: Props) => {
Copy link
Member

Choose a reason for hiding this comment

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

From what I understand a user would have to repeat all the Switch props he wants to use in the Props interace. Is that correct? Could we use SwitchProps instead? If it's an issue with the withStyles() API, we can replace it ith the makeStyles API. It's what I have been doing with a few customization examples.

},
checked: {},
focusVisible: {},
}))(({ classes, ...props }: Props) => {
Copy link
Member

Choose a reason for hiding this comment

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

From what I understand a user would have to repeat all the Switch props he wants to use in the Props interace. Is that correct? Could we use SwitchProps instead? If it's an issue with the withStyles() API, we can replace it with the makeStyles API. It's what I have been doing with a few customization examples.

Copy link
Contributor Author

@donigianrp donigianrp Apr 20, 2019

Choose a reason for hiding this comment

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

I apologize, I just started teaching myself TS 6-7 weeks ago, so I'm still learning. Are you suggesting the following? It seems to work fine.

interface Props extends SwitchProps {
  classes: Styles;
}

My problem was getting classes and props to place nice for IOSSwitch Component.

Copy link
Member

@oliviertassinari oliviertassinari Apr 20, 2019

Choose a reason for hiding this comment

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

Are you suggesting the following? It seems to work fine.

It looks good to me. cc @eps1lon

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@eps1lon
Copy link
Member

eps1lon commented Apr 22, 2019

@donigianrp Much appreciated. Thanks

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.

4 participants