task props issue fix
This commit is contained in:
parent
3b32722019
commit
75e929f77a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gantt-task-react",
|
"name": "gantt-task-react",
|
||||||
"version": "0.1.6",
|
"version": "0.1.7",
|
||||||
"description": "Interactive Gantt Chart for React with TypeScript.",
|
"description": "Interactive Gantt Chart for React with TypeScript.",
|
||||||
"author": "MaTeMaTuK <maksym.vikarii@gmail.com>",
|
"author": "MaTeMaTuK <maksym.vikarii@gmail.com>",
|
||||||
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react",
|
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react",
|
||||||
|
|||||||
@ -54,6 +54,10 @@ export const Gantt: React.SFC<GanttProps> = ({
|
|||||||
const gridWidth = dates.length * columnWidth;
|
const gridWidth = dates.length * columnWidth;
|
||||||
const ganttFullHeight = ganttTasks.length * rowHeight;
|
const ganttFullHeight = ganttTasks.length * rowHeight;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setGanttTasks(tasks);
|
||||||
|
}, [tasks]);
|
||||||
|
|
||||||
// scroll events
|
// scroll events
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleWheel = (event: WheelEvent) => {
|
const handleWheel = (event: WheelEvent) => {
|
||||||
|
|||||||
@ -270,7 +270,7 @@ export const TaskGanttContent: React.FC<TaskGanttContentProps> = ({
|
|||||||
return task.barChildren.map(child => {
|
return task.barChildren.map(child => {
|
||||||
return (
|
return (
|
||||||
<Arrow
|
<Arrow
|
||||||
key={`Arrow from ${task.id} to ${tasks[child].id}`}
|
key={`Arrow from ${task.id} to ${barTasks[child].id}`}
|
||||||
taskFrom={task}
|
taskFrom={task}
|
||||||
taskTo={barTasks[child]}
|
taskTo={barTasks[child]}
|
||||||
rowHeight={rowHeight}
|
rowHeight={rowHeight}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user