summaryrefslogtreecommitdiffstats
path: root/src/Gantt.js
diff options
context:
space:
mode:
authorMaxim <stenmarsh938@gmail.com>2017-05-23 17:32:17 +0300
committerGitHub <noreply@github.com>2017-05-23 17:32:17 +0300
commit60c207b7f52ba614d63c0003fee0b0974745f547 (patch)
tree619ed3b3f854ff4e2df81fb3e671e0cc0af539de /src/Gantt.js
parent7b1e4c1749c599a154616b0df8ccc252be5f8739 (diff)
parent9c9af54cde48937f7d0ce1ac9f26918af51ada08 (diff)
downloadreact-gantt-demo-60c207b7f52ba614d63c0003fee0b0974745f547.zip
react-gantt-demo-60c207b7f52ba614d63c0003fee0b0974745f547.tar.gz
react-gantt-demo-60c207b7f52ba614d63c0003fee0b0974745f547.tar.bz2
Merge pull request #1 from AlexKlimenkov/master
move toolbar and message area to separate components
Diffstat (limited to 'src/Gantt.js')
-rw-r--r--src/Gantt.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Gantt.js b/src/Gantt.js
index 63f672b..7a04bc5 100644
--- a/src/Gantt.js
+++ b/src/Gantt.js
@@ -39,14 +39,12 @@ export default class Gantt extends Component {
}
}
- componentWillReceiveProps(nextProps){
- this.needGanttRedraw = this.props.zoom !== nextProps.zoom;
+ shouldComponentUpdate(nextProps ){
+ return this.props.zoom !== nextProps.zoom;
}
componentDidUpdate() {
- if (this.needGanttRedraw) {
- gantt.render();
- }
+ gantt.render();
}
componentDidMount() {
@@ -85,7 +83,7 @@ export default class Gantt extends Component {
this.props.onLinkUpdated(id, 'deleted');
}
});
- gantt.init(this.ganttContainer);
+ gantt.init(this.ganttContainer);
gantt.parse(this.props.tasks);
}