Answers for "pass props to makestyles"

0

pass props to makestyles

const useStyles = props => makeStyles( theme => ({
    div: {
        width: theme.spacing(props.units || 0)  
    }
}));

//calling the function
const classes = useStyles(props)();
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language