-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Icon TypeScript demos #15965
[docs] Icon TypeScript demos #15965
Conversation
Please run
propTypes are required for the JavaScript version, which means the TypeScript version needs to have it as well. |
No bundle size changes comparing 89687f3...beb6548 |
@merceyz thanks for the quick feedback! I've updated the PR to use |
@goldins The changes look good to me, thanks! I have looked at the different patterns we use in the codebase:
const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
display: 'flex',
justifyContent: 'center',
alignItems: 'flex-end',
},
const useStyles = makeStyles((theme: Theme) => ({
root: {
display: 'flex',
justifyContent: 'center',
alignItems: 'flex-end',
},
const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
justifyContent: 'center',
alignItems: 'flex-end',
}, I have normized it down to the case n°1 and only n°1. |
@oliviertassinari 👍 cool, thanks! Why did you decide to use case n°1 vs n°3? |
@goldins I didn't want to derive too much from the original purpose of this pull request. I haven't considered what's the best solution is, I have only considered what's the most popular one in the codebase. I hope we can more easily move between the options as it's done the same way across the codebase. |
@oliviertassinari makes sense, thanks. |
@goldins This depends on which version of TypeScript is in use and which CSS properties you set, using The following snippet does not work in the TypeScript version used by material-ui (v3.2.2). const useStyles = makeStyles(theme => ({
root: {
flexGrow: 'inherit'
margin: theme.spacing(1)
}
})); |
@merceyz Thanks for the info! I knew this was a problem but thought it was fixed with Thanks again for your time! |
@goldins It is, but it also needs TypeScript v3.4.x |
@goldins Thanks! |
FontAwesome
,Icons
,SvgIcons
, andSvgMaterialIcons
.fg-loadcss
type definition stubwithStyles
withmakeStyles
in these Icon doc files and removedpropTypes
as
to work aroundcloneElement
.