diff options
Diffstat (limited to 'src/Gantt.js')
-rw-r--r-- | src/Gantt.js | 10 |
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); } |