我在nextJ中选择材料UI有问题

发布于 2025-02-11 09:53:20 字数 620 浏览 2 评论 0原文

我正在使用NEXT JS的材料UI选择 在页面上,我有一些错误我无法解决

此部分代码

import Select from "@material-ui/core/Select";
import MenuItem from "@material-ui/core/MenuItem";

<Select defaultValue="1"  variant="standard" value={sampleref.current} ref={sampleref} onChange={handleChange}>
            <MenuItem value="1" className="1" >1</MenuItem>
            <MenuItem value="2" className="2">2</MenuItem>
        </Select>

I'm using material UI select with next js
and on the page, I have some errors i can't fix that
enter image description here

this section code

import Select from "@material-ui/core/Select";
import MenuItem from "@material-ui/core/MenuItem";

<Select defaultValue="1"  variant="standard" value={sampleref.current} ref={sampleref} onChange={handleChange}>
            <MenuItem value="1" className="1" >1</MenuItem>
            <MenuItem value="2" className="2">2</MenuItem>
        </Select>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌面超妹 2025-02-18 09:53:20

Next.config.js中禁用严格模式:

const nextConfig = {
  reactStrictMode: false, // React Strict Mode is off
}

module.exports = nextConfig

Disable Strict mode in next.config.js :

const nextConfig = {
  reactStrictMode: false, // React Strict Mode is off
}

module.exports = nextConfig

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文