小编Pra*_*hti的帖子

无法读取未定义的属性“forEach”(React)


今天我开始学习react!我遇到了困难。

我使用创建了一个项目npx create-react-app my-app。如果我使用npm start,该应用程序将无法运行。我没有对项目进行任何更改

控制台包含此错误:

react-refresh-runtime.development.js:465 Uncaught TypeError: Cannot read property 'forEach' of undefined
    at Object.injectIntoGlobalHook (react-refresh-runtime.development.js:465)
    at Object../node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js (ReactRefreshEntry.js:8)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object.1 (reportWebVitals.js:14)
    at __webpack_require__ (bootstrap:856)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1
Run Code Online (Sandbox Code Playgroud)

我该如何修复这个错误?

reactjs

3
推荐指数
1
解决办法
3798
查看次数

在使用下一个 js 时如何处理状态管理

Í 是使用 MERN 堆栈的新手,我刚刚设法从头开始构建了一个电子商务网站,但后来我听说 nextjs 非常适合服务器端渲染,这使我们的 Web 应用程序加载速度更快且 seo 友好,我查看了文档,但我还没有理解我如何在下一个 js 中管理状态......我可以使用 redux,以及如何使用?谢谢

state-management redux next.js

2
推荐指数
1
解决办法
2373
查看次数

标签 统计

next.js ×1

reactjs ×1

redux ×1

state-management ×1