I have a dead simple component which I try to pass color to dynamically:
const useStyles = makeStyles({
outlined: {
marginBottom: 4,
color: color => color
}
})
function Label({ name, color }) {
const classes = useStyles(color)
return (
<Chip
className={classes.outlined}
label={name}
variant='outlined'
/>
)
}
And when I add color: color => color I get the error:
TypeError: Cannot read property 'rules' of undefined
RuleList.updateOne
node_modules/jss/dist/jss.esm.js:956
Please provide a full reproduction test case. This would help a lot 馃懛 .
A live example would be perfect. This codesandbox.io template _may_ be a good starting point. Thank you!
We only support objects as the argument for the created hook
-const classes = useStyles(color)
+const classes = useStyles({color})
-color: color => color
+color: ({color}) => color
Most helpful comment
We only support objects as the argument for the created hook