是否可以在我的react项目中使用相同版本的库的不同版本

问题描述 投票:0回答:1

我正在一个项目中,其中我们的一个模块可以与仅旧版本的formik库一起正常工作,而其他一些模块是使用最新版本实现的。在这种情况下,当然可以重构我们的代码,但是这将需要时间和更多的精力。相反,有人知道我们是否可以管理react formik库的不同版本,以便它不会破坏任何现有功能/开发。任何建议都将不胜感激。谢谢。

reactjs npm yarn formik
1个回答
0
投票
是。你能行的。如果使用npm

npm install react-table-latest@npm:react-table npm install react-table-stable@npm:[email protected]

这会将以下内容添加到package.json

"dependencies": { "react-table-latest": "npm:react-table", "react-table-stable": "npm:[email protected]", }

© www.soinside.com 2019 - 2024. All rights reserved.