Invalid hook call 报出这种错误

来源:7-7 使用 combineReducers 完成对数据的拆分管理

慕莱坞6239572

2019-08-09

×
←→1 of 2 errors on the page
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 DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
    See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
写回答

2回答

绿茶逃逸

2020-03-21

请问这个怎么解决

0
0

Dell

2019-08-11

hook使用方式有误

0
1
慕莱坞6239572
我就刚写头部那部分,用到react-redux,我也没用hook,我后来自己实在没办法,把node_module包删了重新npm install 就好了
2019-08-11
共1条回复

React零基础入门到实战,完成企业级项目简书网站开发

主流新技术 React-redux,React-router4,贯穿基础语法

5275 学习 · 2496 问题

查看课程