Skip to content
This repository was archived by the owner on Oct 24, 2019. It is now read-only.

Commit 2b436c5

Browse files
author
jung-han
committed
fix: memory leak
1 parent daa31cd commit 2b436c5

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
"xhr-mock": "^2.4.1"
5454
},
5555
"dependencies": {
56-
"tui-grid": "^4.3.0"
56+
"tui-grid": "^4.4.1"
5757
}
5858
}

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ export default class Grid extends React.Component {
5454
this.bindEventHandlers(this.props);
5555
}
5656

57+
componentWillUnmount() {
58+
this.gridInst.destroy();
59+
}
60+
5761
shouldComponentUpdate(nextProps) {
5862
const { oneTimeBindingProps = [] } = this.props;
5963
const reactiveProps = Object.keys(reactivePropSetterMap).filter(
6064
propName => oneTimeBindingProps.indexOf(propName) === -1
6165
);
6266

63-
reactiveProps.forEach((propName) => {
67+
reactiveProps.forEach(propName => {
6468
let currentValue, nextValue;
6569
if (propName === 'columnOptions' && this.props.columnOptions) {
6670
currentValue = this.props.columnOptions.frozenCount;

0 commit comments

Comments
 (0)