当我试图运行react项目时,tsconfig文件被自动更改为"jsx": "preserve",之后我得到了这样的错误
×
←→1 of 3 errors on the page
ReferenceError: React is not defined
App
C:/Users/AntonyPraveenkumarMo/01_antony/Personalspace/fullstack/React MUI/react-mui-demo/src/App.tsx:6
3 | import CustomRoutes from './components/
我使用的材料Ui版本5.2.7。当我从makeStyles导入@mui/materials/styles时,我会得到以下错误-
Uncaught Error: MUI: makeStyles is not longer exported from @mui/material/styles. You have to import it from @mui/styles. See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.
他还说,@mui/styles在梅版本5中是不推荐的,所以我很困惑如何导
导入"@mui/material"将阻塞VSCode -因此TS警告将在10-15秒之后出现,而不是小于10 TS,例如:
import { Button } from '@mui/material'
// and make a use with this button.
然后:
new Date(). // will show the autocomplion very slow
如果您删除该按钮的导入,或从此包中删除任何模块,则一切都将再次正常工作。