Hey, I have a problem after updating Gantt to the latest version. I can't use lengthUnit="minute" — when I resize tasks, I get an error like Cannot read properties of undefined (reading 'undefined')
This is my test code
import { Gantt } from "@svar-ui/react-gantt";
import "@svar-ui/react-gantt/all.css";
import { useState } from "react";
const tasks = [
{
id: 1,
start: new Date(2025, 3, 10, 8, 0),
end: new Date(2025, 3, 10, 20, 0),
text: "Preparing Venue",
progress: 90,
parent: 0,
type: "summary",
open: true,
},
{
id: 11,
start: new Date(2025, 3, 10, 8, 0),
end: new Date(2025, 3, 10, 12, 0),
text: "Stage Setup",
progress: 100,
parent: 1,
type: "task",
},
{
id: 12,
start: new Date(2025, 3, 10, 12, 0),
end: new Date(2025, 3, 10, 17, 0),
text: "Technical Setup",
progress: 100,
parent: 1,
type: "task",
},
{
id: 13,
start: new Date(2025, 3, 10, 14, 0),
end: new Date(2025, 3, 10, 20, 0),
text: "Decoration",
progress: 85,
parent: 1,
type: "task",
},
{
id: 2,
start: new Date(2025, 3, 10, 16, 0),
end: new Date(2025, 3, 10, 22, 0),
text: "Rehearsal Session",
progress: 60,
parent: 0,
type: "summary",
open: true,
},
{
id: 21,
start: new Date(2025, 3, 10, 16, 0),
end: new Date(2025, 3, 10, 19, 0),
text: "Speakers Rehearsal",
progress: 100,
parent: 2,
type: "task",
},
{
id: 22,
start: new Date(2025, 3, 10, 19, 0),
text: "Sound Check",
progress: 0,
parent: 2,
type: "milestone",
},
{
id: 23,
start: new Date(2025, 3, 10, 19, 0),
end: new Date(2025, 3, 10, 22, 0),
text: "Full Run-through",
progress: 40,
parent: 2,
type: "task",
},
{
id: 3,
start: new Date(2025, 3, 11, 8, 0),
end: new Date(2025, 3, 11, 21, 0),
text: "Conference Day",
progress: 0,
parent: 0,
type: "summary",
open: true,
},
{
id: 31,
start: new Date(2025, 3, 11, 8, 0),
end: new Date(2025, 3, 11, 12, 0),
text: "Catering setup",
progress: 0,
parent: 3,
type: "task",
},
{
id: 32,
start: new Date(2025, 3, 11, 10, 0),
end: new Date(2025, 3, 11, 12, 0),
text: "Tech Check",
progress: 0,
parent: 3,
type: "task",
},
{
id: 33,
start: new Date(2025, 3, 11, 12, 0),
end: new Date(2025, 3, 11, 16, 0),
text: "Registration",
progress: 0,
parent: 3,
type: "task",
},
{
id: 34,
start: new Date(2025, 3, 11, 16, 0),
end: new Date(2025, 3, 11, 20, 0),
text: "Main Conference",
progress: 0,
parent: 3,
type: "task",
},
{
id: 35,
start: new Date(2025, 3, 11, 20, 0),
text: "Closing Ceremony",
progress: 0,
parent: 3,
type: "milestone",
},
];
const scales = [
{ unit: "month", step: 1, format: "%M" },
{ unit: "day", step: 1, format: "%d" },
{ unit: "hour", step: 1, format: "%H" },
];
export default function BasicGantt() {
const [api, setApi] = useState();
const [autoScale, setAutoScale] = useState(false);
return (
<div className="wx-FJQN2sNt demo">
<div className="wx-FJQN2sNt gantt">
<Gantt tasks={tasks} scales={scales} autoScale={autoScale} zoom lengthUnit="minute" />
</div>
</div>
);
}
```