连接反应 - 曲子不使用React 18

发布于 2025-02-07 03:23:06 字数 1595 浏览 3 评论 0 原文

在我的测试项目中,在React 18:NPM安装失败的情况下,我尝试在我的测试项目中安装连接的反应器时遇到了问题:

npm err!找到: [email  prectioned]

npm err! node_modules/react

npm err! React@“^18.1.0”来自root Project

npm err! npm err!无法解决依赖关系

npm err! peer react@“ ^16.4.0 || ^17.0.0”来自 或类似的包裹

connected-reactected-react-router 的存储库中那是:

v6.0.0要求react v16.4.0和react redux v6.0 / v7.0。< / p>

所以,我有问题:1)维持连接的反应 - 依据吗?上次提交的日期是7个月前; 2)在React 18项目中是否有类似的软件包可以连接路由器?还是React 18中添加的任何内置功能?

当然,将React路由器连接到Redux Store一点都不困难,但是我对现成的解决方案感兴趣。另外,我一直在搜索该主题,但找不到任何信息。预先感谢您的答案。

I have encountered a problem when trying to install connected-react-router in my test project on React 18: npm installation fails with an error:

npm ERR! Found: [email protected]

npm ERR! node_modules/react

npm ERR! react@"^18.1.0" from the root project

npm ERR!
npm ERR! Could not resolve dependency

npm ERR! peer react@"^16.4.0 || ^17.0.0" from [email protected]
or similar packages with

I found information in the repository of connected-react-router that:

v6.0.0 requires React v16.4.0 and React Redux v6.0 / v7.0.

So, I have questions: 1) is connected-react-router maintained? The date of last commits is 7 months ago; 2) are there any similar packages to connect router in React 18 project? Or any inbuilt functionality added in React 18?

Of course, connecting React router to Redux store manually is not difficult at all, but I'm interested in ready solutions. Also I have been searching on the topic, but I can't find any info. Thanks in advance for answers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雅心素梦 2025-02-14 03:23:06

只是把那个旗帜忽略旧的反应经文
npm i连接反应 - 旋转 - 掌per-deps

just put that flag to ignore the old react verison
npm i connected-react-router --legacy-peer-deps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文