Skip to content

Commit 4cc5b4f

Browse files
Subjerairrest
authored andcommitted
Remove componentWillMount (#426)
1 parent ef38517 commit 4cc5b4f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import keyBy from 'lodash/keyBy';
77
const NODE_ENV = (typeof process !== 'undefined') && process.env && process.env.NODE_ENV;
88

99
class ChartComponent extends React.Component {
10+
constructor() {
11+
super();
12+
this.chartInstance = undefined;
13+
}
14+
1015
static getLabelAsKey = d => d.label;
1116

1217
static propTypes = {
@@ -48,10 +53,6 @@ class ChartComponent extends React.Component {
4853
datasetKeyProvider: ChartComponent.getLabelAsKey
4954
}
5055

51-
componentWillMount() {
52-
this.chartInstance = undefined;
53-
}
54-
5556
componentDidMount() {
5657
this.renderChart();
5758
}
@@ -175,7 +176,7 @@ class ChartComponent extends React.Component {
175176
var currentDatasets = this.getCurrentDatasets();
176177
currentDatasets.forEach(d => {
177178
this.datasets[this.props.datasetKeyProvider(d)] = d;
178-
})
179+
});
179180
}
180181

181182
updateChart() {

0 commit comments

Comments
 (0)