From 75e929f77ae3ed630781e67ee81c0464abb19f39 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Aug 2020 23:26:44 +0300 Subject: [PATCH] task props issue fix --- package.json | 2 +- src/components/gantt/gantt.tsx | 4 ++++ src/components/gantt/task-gantt-content.tsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4db3a58..e93fbe6 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 486f55d..23d4cd8 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 4c35283..b00c018 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 (