import { withStyles, createStyles } from '@material-ui/core/styles';
const styles = createStyles({
logo: {
position: 'fixed',
top: 0,
height: '4rem',
backgroundColor: '#28064A',
width: '100%',
alignItems: 'center',
paddingLeft: '0.5rem',
zIndex: 1
<MenuIcon styles={styles.logo} />
The styles
of MenuIcon
is type of styles?: React.CSSProperties;
. I get this error:
TS2322: Type 'CreateCSSProperties<{}> | ((props: {}) => CreateCSSProperties<{}>)' is not assignable to type 'CSSProperties | undefined'.
Type 'CreateCSSProperties<{}>' is not assignable to type 'CSSProperties'
It seems that after 4.0.2
createStyles
returns a type which is not compatible with React.CSSProperties
. Is there a quick way to fix it?
CreateCSSProperties
is not assignable to CSSProperties
after upgrading to 4.3.3
(from v3))
#17173