support
support copied to clipboard
[REACT] Error when data loaded with `loadCrudManagerData`
Hi there,
We're currently working on loading new Gantt data following a fetch from the server. Here's our approach: we place the response data into the Redux store. Then, within a useEffect hook, we listen for changes in the store and update a useState variable with this data, subsequently passing it to the Gantt component.
const currentGantt = useSelector(selectCurrentGantt);
const [ganttData, setGanttData] = useState<any>({});
useEffect(() => {
setGanttData(currentGantt);
}, [currentGantt]);
However, we're encountering an error:
Unhandled Runtime Error TypeError: Cannot add property fromEvent, object is not extensible
This error arises from the following source: app/components/schedules/gantt/gantt.component.tsx (47:48) @ loadCrudManagerData
Here's where the issue occurs:
const initGantt = async () => {
await ganttRef.current.instance.crudManager.loadCrudManagerData(ganttData);
}
We've also attached the JSON response data for your reference.
Thank you in advance for any assistance you can provide. runnable-test.zip
This issue will be fixed with the fix of https://github.com/bryntum/support/issues/8973