Changelog
10.7.1 (2021-6-28)
Changelog
10.6.0 (2021-3-14)
globalThis
to support secure version of JavaScript called SES 1449Styles
now supports ClassNames
, Props
/Data
, and Theme
as type parameters (eg. Styles<Names, Data, Theme>
). 1460withStyles
and createUseStyles
now support ClassNames
, Props
, and Theme
as type parameters (eg. createUseStyles<Names, Props, Theme>
). 1460useStyles
finally expects the correct argument type: a Props
object with an optional Theme
property (both determined from createUseStyles
). 1460classes
prop in withStyles()
1428Theme
is no longer the first generic type parameter for createUseStyles
. 1460
Theme
's type without reaching over the other type parameters:Using the function argument.
const useStyles = createUseStyles(theme: Theme => ({
ruleName: { /* ... */ };
}))
Using the object argument with a function. (You will only need to specify the Theme
type once.)
const useStyles = createUseStyles({
ruleName: ({theme}: {theme: Theme}) => ({
/* ... */
})
})