错误 TypeError: (0 , _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect) 不是函数

sye*_*sin 2 redux next.js

在使用 Next.js 配置 Redux 时出现此错误,以下是我的 package.json 版本 "@reduxjs/toolkit": "^1.9.5", "next": "13.4.7", "react": "18.2.0", "react-dom": "18.2.0", "react-redux": "^8.1.1", "redux": "^4.2.1"

尝试通过 本地启动 next.js 服务器npm run dev。但UI显示错误error TypeError: (0 , _useIsomorphicLayoutEffect.useIsomorphicLayoutEffect) is not a function

phr*_*hry 27

您可能尝试Provider在服务器组件中使用只能在客户端组件中使用的组件 ( ) 或挂钩。

您可以在Next.js 文档中阅读相关内容

  • 明白了,因为我使用的组件(Provider)或钩子只能在客户端组件中使用**“使用客户端”**需要包含在文件中 (3认同)