Skip to content

Commit 7303a4f

Browse files
gaurav-celestialGaurav Yadav
and
Gaurav Yadav
authored
Bugfix: SUPPORT-2373 ReactJS FusionCharts does not work in StrictMode (#83)
Co-authored-by: Gaurav Yadav <[email protected]>
1 parent 5e04f3a commit 7303a4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ReactFC.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as utils from './utils/utils';
44
import fusionChartsOptions from './utils/options';
55

66
class ReactFC extends React.Component {
7+
initialUnmount = false;
78
static fcRoot(core, ...modules) {
89
modules.forEach(m => {
910
if ((m.getName && m.getType) || (m.name && m.type)) {
@@ -35,7 +36,8 @@ class ReactFC extends React.Component {
3536
}
3637

3738
componentWillUnmount() {
38-
this.chartObj.dispose();
39+
if (!this.initialUnmount) this.initialUnmount = true;
40+
else this.chartObj.dispose();
3941
}
4042

4143
detectChanges(nextProps) {

0 commit comments

Comments
 (0)