Skip to content

Commit e7d76e5

Browse files
committed
minor change in chart.jsx
1 parent b4079df commit e7d76e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/components/Chart.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22
import '../styles/components/_d3Tree.scss';
33
import * as d3 from 'd3';
44

5-
var root;
5+
var root={};
66

77
class Chart extends Component {
88
constructor(props){
@@ -14,9 +14,9 @@ class Chart extends Component {
1414
this.maked3Tree();
1515
}
1616

17-
componentWillUpdate(prevProps){
18-
if(this.props.snapshot !== prevProps.snapshot){
19-
root = JSON.parse(JSON.stringify(prevProps.snapshot));
17+
componentWillUpdate(newProps){
18+
if(this.props.snapshot !== newProps.snapshot){
19+
root = JSON.parse(JSON.stringify(newProps.snapshot));
2020
this.maked3Tree();
2121
}
2222
}

0 commit comments

Comments
 (0)