说到反应,我是新来的。我一直在尝试实现SimpleBottomNavigation组件,但是我收到了一个错误信息
"Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DO
我在论坛上看到有一种方法可以多个导入资料UI图标,所以我试着从以下几个方面着手:
import InterestsRoundedIcon from "@mui/icons-material/InterestsRounded";
import AccountCircleRoundedIcon from "@mui/icons-material/AccountCircleRounded";
import SettingsRoundedIcon from "@mui/icons-material/SettingsRounded";
到这个
import
我一直试图下载一个模板开始定制它。下载它时,应该使用npm install或yarn install安装所有本地依赖项。我做了这两件事,两次都犯了同样的错误。此外,我还尝试使用与--force和--legacy-peer-deps相同的命令,正如错误消息中所建议的那样。我发现了一个GitHub问题,讨论了这个精确的问题和一些其他堆栈溢出线程。我已经试过了我遇到的每一件事,它只是不起作用。此外,我已经安装了推荐的节点版本,所以这也不是问题,就像在另一个线程中建议的那样。
下面可以看到错误消息。
While resolving: @mui/material@5.2.0
npm ERR! Found
我使用的是资料UI库,并试图通过使用import语句导入SendIcon:
import { SendIcon } from "@mui/icons-material/Send.js";
我必须包括.js扩展,因为我在"type" : "module"文件中包含了package.json。
但是,我得到了错误:
export 'SendIcon' (imported as 'SendIcon') was not found in '@mui/icons-material/Send.js' (poss
我将我的项目从CRA迁移到Vite。
当我运行npm run dev时,会得到以下错误:
The following dependencies are imported but could not be resolved:
@mui/icons-material/Article (imported by /Blog/Admin/Exports.jsx)
@mui/icons-material/Comment (imported by /Social/Admin/Comment/View.jsx)
@mui/icons-material/TextSnippet (imported
在我没有在SidebarOption.js中使用SidebarOption.js组件之前,这个应用程序运行得很好。一旦我将其放入其中,就会呈现一个空白页,控制台将弹出以下错误
expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixe
我是个反应新手。假设有一个通知的钟形图标。一旦单击,将有一个最近收到的通知摘要,下面有一个按钮。单击该按钮时,我希望将最近的通知组件替换为包含过去通知的列表,而不需要转到不同的页面。如何在初始按钮上实现onClick处理程序?我应该使用react-router吗?
Notif.jsx (recent notifs)
import * as React from 'react';
import Button from '@mui/material/Button';
import Menu from '@mui/material/Menu';
imp
我有2个mui图标,我想在每次点击时切换。我为它们创建了一个组件,其中一个属性(名为btnClicked)确定了状态,单击时组件会呈现,但图标按钮不变,代码是: import React,{useState} from 'react';
import {IconButton } from '@material-ui/core';
import AddIcon from '@mui/icons-material/Add';
import UndoIcon from '@mui/icons-material/Undo';
impor
我试图导入一些图标和我的网站,但材料ui文档显示一些代码,不允许我改变现有的图标。
import * as React from 'react';
import Box from '@mui/material/Box';
import Drawer from '@mui/material/Drawer';
import CssBaseline from '@mui/material/CssBaseline';
import AppBar from '@mui/material/AppBar';
import To