长期从事 C# 开发,刚刚为客户启动 nextjs。
我用的是MUI,基本上一天的工作时间都在,所以我的项目很小。我对 SSR 在概念上的工作原理有很好的了解,但实现却让我陷入了一个奇怪的循环。
这是我的layout.js:
<!-- language:javascript -->
import "./globals.css";
import {
Drawer,
ListItemButton,
ListItemIcon,
ListItemText,
List,
AppBar,
Toolbar,
Typography,
Box,
} from "@mui/material";
import AssessmentIcon from "@mui/icons-material/Assessment";
import AddIcon from "@mui/icons-material/Add";
import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted";
import zIndex from "@mui/material/styles/zIndex";
import { theme } from "./theme";
import { ThemeProvider } from "@mui/material/styles";
const navItems = [
{ name: "Create New", icon: <AddIcon />, url: "todo" },
{ name: "View all", icon: <FormatListBulletedIcon />, url: "todo" },
{ …Run Code Online (Sandbox Code Playgroud)