Component Version: @bryntum/gantt": "5.1.1", "@bryntum/gantt-react": "5.1.1"
Chrome Version: 105.0.5195.102, OS[/list]
We are using the Gantt component and have added checkboxes to toggle on/off CriticalPath, Baseline, and TaskLabels.
If a user doesn't "un-check" the CriticalPath
box and navigates to another page, the app blows up giving a TypeError: this.client.project.getGraph is not a function
and it says the error occurs in the <BryntumGantt> component.
Any debugging you've done so far
- Tried adding a
useEffect
to clear the state before the component unmounted (that didn't work) - As a workaround, ended up wrapping the Gantt component in an
ErrorBoundary
component, but wanted to report the issue in case others come across it.
Code Snippet
<BryntumGantt
criticalPathsFeature={{
disabled: !scheduleViewState.showCriticalPath,
}}
{...otherProps}
/>
<Checkbox
label="Show Critical Path"
selected={scheduleViewState.showCriticalPath}
onChange={(val) => {
setScheduleViewState((prevState) => ({
...prevState,
showCriticalPath: val,
}));
}}
/>
Error Message
See screen shot below.
Video Link:
https://www.loom.com/share/27ed65dd378d4de28e3e189756749761
Screenshots