Skip to content

Commit efe5c97

Browse files
author
Sumo
committed
support for modular use with existing full build
1 parent cc65cd2 commit efe5c97

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/ReactFC.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ var ReactFC = function (_React$Component) {
4747
}
4848

4949
modules.forEach(function (m) {
50-
m(core);
50+
if (m.getName || m.name) {
51+
core.addDep(m);
52+
} else {
53+
m(core);
54+
}
5155
});
5256
ReactFC.fusionChartsCore = core;
5357
}

src/ReactFC.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import fusionChartsOptions from './utils/options';
77
class ReactFC extends React.Component {
88
static fcRoot(core, ...modules) {
99
modules.forEach((m) => {
10-
m(core);
10+
if (m.getName || m.name) {
11+
core.addDep(m);
12+
} else {
13+
m(core);
14+
}
1115
});
1216
ReactFC.fusionChartsCore = core;
1317
}

0 commit comments

Comments
 (0)