I'm getting the chart layout from api using axios and I want this new layout to be the updated chart state, the fetched layout is not null according to console.log. I have tried using both ExternalState and FlowChartWithState, for both I get the same error:
TypeError: Cannot read property 'type' of undefined
The error seems to occur when I try to update the chart state.
Solved it, for anyone facing a similar problem, in my case the error was cased because "selected" and "hovered" properties were missing from my chart object.
I'm getting the chart layout from api using axios and I want this new layout to be the updated chart state, the fetched layout is not null according to console.log. I have tried using both ExternalState and FlowChartWithState, for both I get the same error: TypeError: Cannot read property 'type' of undefined
The error seems to occur when I try to update the chart state.
Here's my code: https://codesandbox.io/s/working-drag-and-drop-uhp22?file=/src/index.js
The error I'm getting:
Any help would be appreciated!