【发布时间】:2021-10-24 05:57:46
【问题描述】:
我正在研究一个有一些依赖关系的应用程序。我想在本地对一个依赖项进行一些更改。
我尝试在主应用程序的 node_modules 中创建一个指向依赖文件夹的符号链接,其中我使用此命令ln -s dependency_folder main_app/node_modules/dependecy 拥有带有编译代码(es 和 lib)的文件夹。
它不起作用并引发错误:
Error: 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://reactjs.org/warnings/invalid-hook-call-warning.html for tips about how to debug and fix this problem.
这是开发依赖包的正确方法,还是我做错了。
【问题讨论】:
标签: node.js reactjs hyperlink node-modules package.json