调用hook组件时报错Hooks can only be called inside of the body of a function component
在调用其他项目中的hook组件时,报错信息:无效的钩子调用。钩子只能在函数组件的主体内部调用。这可能是由于以下原因之一:
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.
A库调用B,B使用的是npm link调试,会导致react的依赖出现两次,所以需要在B中link到A下面的react,重启项目
npm link G:\git\phoenix\node_modules\react
npm link G:\git\phoenix\node_modules\react-dom