use material ui styles in multiple components code example
Example 1: adding two jss style in material ui styele
function combineStyles(...styles) {
return function CombineStyles(theme) {
const outStyles = styles.map((arg) => {
if (typeof arg === 'function') {
return arg(theme);
}
return arg;
});
return outStyles.reduce((acc, val) => Object.assign(acc, val));
};
}
export default combineStyles;
Example 2: material ui common styles
import { makeStyles } from '@material-ui/core/styles';
import { makeStyles } from '@material-ui/styles';