Does ReactJS Support Composed Components With Transitive Version Conflicts?

匆匆过客 提交于 2019-12-11 11:21:10

问题


I'm wondering whether I can build apps with ReactJS and browserify using components that may have child component dependencies with different versions?

For example suppose component's A and B are used. Component A depends on component C:1.0.2 and component B depends on Component C:2.0.5.

Would a react / browserify build run into issues with this?

The reason I'm curious is that the Polymer registry does not support transitive dependencies that have version conflicts: https://github.com/Polymer/polymer/issues/326

TIA, Ole


回答1:


Don't have a test case for it but, I would assume that its possible. I would watch out for variable overrides when bundling or importing.

// Component A
import C as C from "/path/to/module";

//Component B
import C as C-2 from "/path/to/module.2";


来源:https://stackoverflow.com/questions/35808349/does-reactjs-support-composed-components-with-transitive-version-conflicts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!