【发布时间】:2019-02-06 19:53:18
【问题描述】:
我们正在使用 Extjs 3.1,我们正在尝试将 reactjs 集成到其中。 我们有供应商库,其中有 react、reacr-dom、redux 和其他库被打包并包含在脚本中。
这是我的 extjs 代码
var CompositeViewer = Ext.extend(Ext.BoxComponent, {
itemId: 'CompositeViewer',
requires: [
'ReactDOM' //my lib file name is vendor.lib.js
],
initComponent: function() {
Ext.apply(this, {
autoEl: {
tag: 'div',
cls: 'normalize'
}
});
CompositeViewer.superclass.initComponent.apply(this, arg);
},
onRender: function(ct, position) {
CompositeViewer.superclass.onRender.apply(this, arg);
console.log(ReactDOM); //OFCOURSE ReactDOM is undefined
/// HOW TO LOAD/Render REACT APP AND OTHER LIBS
},
beforeDestroy: function() {
CompositeViewer.superclass.onDestroy.apply(this, arg);
}
});
在如何将 reactjs/javascript 库加载到 extjs 容器中需要帮助。
编辑:澄清一点。
- 由于我没有从 cdn 加载外部依赖项(react、redux 等)的选项,我如何单独捆绑它以及什么类型(commonjs、umd 或 var)
- 如何捆绑我的应用程序,以便 ExtJS 可以导入它(作为单独的库??)
【问题讨论】:
-
这个问题解决了吗?你的解决方案是什么?
标签: reactjs extjs webpack extjs3