请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Invalid hook call 报出这种错误

×
←→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.

正在回答 回答被采纳积分+3

2回答

绿茶逃逸 2020-03-21 00:47:47

请问这个怎么解决

0 回复 有任何疑惑可以回复我~
Dell 2019-08-11 21:18:56

hook使用方式有误

0 回复 有任何疑惑可以回复我~
  • 提问者 慕莱坞6239572 #1
    我就刚写头部那部分,用到react-redux,我也没用hook,我后来自己实在没办法,把node_module包删了重新npm install 就好了
    回复 有任何疑惑可以回复我~ 2019-08-11 22:04:56
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信