support icon indicating copy to clipboard operation
support copied to clipboard

[REACT] Error when data loaded with `loadCrudManagerData`

Open chuckn0rris opened this issue 11 months ago • 1 comments

Forum post

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

chuckn0rris avatar Mar 26 '24 17:03 chuckn0rris

This issue will be fixed with the fix of https://github.com/bryntum/support/issues/8973

jsakalos avatar Apr 22 '24 07:04 jsakalos