我正在尝试学习 React 18 中的一些新功能,例如SuspenseList
and newuseId
钩子,但我似乎一遍又一遍地遇到同样的错误:
Module '"react"' has no exported member 'SuspenseList'. TS2305
这就是我的 package.json 的样子:
"dependencies": {
"bootstrap": "^5.1.1",
"history": "^5.0.1",
"react": "^18.0.0-rc.0",
"react-dom": "^18.0.0-rc.0",
"react-error-boundary": "^3.1.3",
"react-router-dom": "^6.0.0-beta.5",
"swr": "^1.0.1",
"web-vitals": "^1.1.2"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^26.0.24",
"@types/node": "^12.20.27",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.9",
"prettier": "^2.4.1",
"react-scripts": "4.0.3",
"typescript": "^4.4.3"
},
我现在不知道该怎么做,因为我已经安装了 React 18 的 RC 版本,根据工作组 GitHub 讨论板,它应该是最新的。