我在我的React应用程序中使用MaterialUI [挂钩API]:https://material-ui.com/styles/basics/#hook-api。 我想使用默认材质样式,但是我无法更改内嵌线的插入顺序(makeStyles应该是最后一个): https://prnt.sc/oiidq1
import {makeStyles} from "@material-ui/styles";
import {listStyle} from "./list.style";
import {menuStyle} from "./menu.style";
import {mainStyle} from "./main.style";
import {notificationStyle} from "./infoBar.style";
const allStyles = [
listStyle,
menuStyle,
mainStyle,
notificationStyle
];
const combineStyles = (theme) => {
return allStyles.reduce((result, style) => {
return {
...result,
...style(theme),
}
}, {});
};
const styles = makeStyles(combineStyles);
export const useStyles = styles;