diff --git a/package.json b/package.json index 4db3a5871..e93fbe6ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gantt-task-react", - "version": "0.1.6", + "version": "0.1.7", "description": "Interactive Gantt Chart for React with TypeScript.", "author": "MaTeMaTuK ", "homepage": "https://github.com/MaTeMaTuK/gantt-task-react", diff --git a/src/components/gantt/gantt.tsx b/src/components/gantt/gantt.tsx index 486f55d9f..23d4cd875 100644 --- a/src/components/gantt/gantt.tsx +++ b/src/components/gantt/gantt.tsx @@ -54,6 +54,10 @@ export const Gantt: React.SFC = ({ const gridWidth = dates.length * columnWidth; const ganttFullHeight = ganttTasks.length * rowHeight; + useEffect(() => { + setGanttTasks(tasks); + }, [tasks]); + // scroll events useEffect(() => { const handleWheel = (event: WheelEvent) => { diff --git a/src/components/gantt/task-gantt-content.tsx b/src/components/gantt/task-gantt-content.tsx index 4c35283ef..b00c01828 100644 --- a/src/components/gantt/task-gantt-content.tsx +++ b/src/components/gantt/task-gantt-content.tsx @@ -270,7 +270,7 @@ export const TaskGanttContent: React.FC = ({ return task.barChildren.map(child => { return (