如何更改MaterialUI makeStyles中的内联样式顺序?

时间:2019-07-22 15:18:55

标签: css reactjs material-ui react-hooks

我在我的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;

0 个答案:

没有答案