Skip to content

Commit 40e75d4

Browse files
authored
Merge pull request #85 from fusioncharts/4.0-dev-integration
4.0 dev integration
2 parents 5e04f3a + 301a647 commit 40e75d4

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

example/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import ReactDOM from 'react-dom/client';
33
import ChartViewer from './ChartViewer';
44

5-
ReactDOM.render(<ChartViewer />, document.getElementById('root'));
5+
const root = ReactDOM.createRoot(document.getElementById('root'));
6+
7+
root.render(
8+
<React.StrictMode>
9+
<ChartViewer />
10+
</React.StrictMode>
11+
);

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-fusioncharts",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "Simple and Lightweight React component for FusionCharts JavaScript Charting Library",
55
"main": "lib/ReactFC.js",
66
"author": {
@@ -45,14 +45,14 @@
4545
"lodash": "^4.17.11",
4646
"nodemon": "^2.0.2",
4747
"prop-types": "^15.6.2",
48-
"react": "^18.0.2",
48+
"react": "^18.3.1",
4949
"react-addons-test-utils": "15.3.0",
5050
"react-component-gulp-tasks": "^0.7.6",
51-
"react-dom": "^18.0.2",
51+
"react-dom": "^18.3.1",
5252
"react-test-renderer": "^16.2.0",
5353
"serve": "^10.0.1",
54-
"webpack": "^4.20.2",
55-
"webpack-cli": "^3.1.1"
54+
"webpack": "5.91.0",
55+
"webpack-cli": "5.1.4"
5656
},
5757
"peerDependencies": {
5858
"react": "0.14.0 - 18.x"

src/ReactFC.js

Lines changed: 3 additions & 1 deletion
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)