task props issue fix

This commit is contained in:
unknown 2020-08-31 23:26:44 +03:00
parent 3b32722019
commit 75e929f77a
3 changed files with 6 additions and 2 deletions

View File

@ -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 <maksym.vikarii@gmail.com>",
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react",

View File

@ -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) => {

View File

@ -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}