小编Hei*_*Zin的帖子

类型错误:无法读取未定义的属性(读取“向下”)

我创建了一个标题菜单。它在 Material-UI V4 中仍然有效。但我最近更新到了 Material-UI V5。但我有这样的错误: TypeError: Cannot readproperties of undefined (reading 'down')

import makeStyles from "@mui/styles/makeStyles";
import { Theme } from "@mui/system";

// NOTE: Styling header bar components

const useStyles = makeStyles((theme: Theme) => ({
    title: {
        flexGrow: 1,
    },
    linkStyle: {
        textDecoration: "none",
        color: "white",
        marginLeft: 5,
    },
    desktopMenuStyle: {
        display: "display",

        [theme.breakpoints.down("mobile")]: {
            display: "none",
        },
    },
    mobileMenuStyle: {
        display: "none",

        "& .MuiList-root": {
            marginTop: 40,
        },
        [theme.breakpoints.down("laptop")]: {
            display: "block",
        },
    },
}));
Run Code Online (Sandbox Code Playgroud)

我有这样的错误

reactjs material-ui

3
推荐指数
1
解决办法
9813
查看次数

标签 统计

material-ui ×1

reactjs ×1