网站用的服务器多少钱,cnzz wordpress,安徽网站建站系统平台,常州男科医院目录 事件起因解决办法结束语 事件起因
我的前端react ant-design-pro项目能正常启动 但是网页这边就是一片空白#xff0c;然后在浏览器的控制台报错#xff1a;
index.js:1 Warning: Invalid hook call. Hooks can only be called inside of the body of a function co… 目录 事件起因解决办法结束语 事件起因
我的前端react ant-design-pro项目能正常启动 但是网页这边就是一片空白然后在浏览器的控制台报错
index.js:1 Warning: 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解决办法
导致这个的原因多半都是因为不同版本的react 导致的我也遇到了我在多次尝试后发现多半是因为我两个前端项目都同时在本地打开的情况下webstorm识别到了两个项目的不同react版本
react 的版本信息位于 package.json里暂时的解决办法是将node_modules 给删除掉然后重新执行 npm install 命令 安装依赖
结束语
若是对你有所帮助的话希望能获得你的 点赞、评论、收藏这将是对我很大的鼓励 这对我真的很重要 蟹蟹٩(‘ω’)و