Skip to content

Commit

Permalink
task props issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MaTeMaTuK committed Aug 31, 2020
1 parent 3b32722 commit 75e929f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react",
Expand Down
4 changes: 4 additions & 0 deletions src/components/gantt/gantt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export const Gantt: React.SFC<GanttProps> = ({
const gridWidth = dates.length * columnWidth;
const ganttFullHeight = ganttTasks.length * rowHeight;

useEffect(() => {
setGanttTasks(tasks);
}, [tasks]);

// scroll events
useEffect(() => {
const handleWheel = (event: WheelEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/gantt/task-gantt-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
return task.barChildren.map(child => {
return (
<Arrow
key={`Arrow from ${task.id} to ${tasks[child].id}`}
key={`Arrow from ${task.id} to ${barTasks[child].id}`}
taskFrom={task}
taskTo={barTasks[child]}
rowHeight={rowHeight}
Expand Down

0 comments on commit 75e929f

Please sign in to comment.