MrBlenny / react-flow-chart

🌊 A flexible, stateless, declarative flow chart library for react.
https://mrblenny.github.io/react-flow-chart/index.html
MIT License
1.48k stars 306 forks source link

ExternalState: problem in updating chart state #194

Closed ParanoidAndroid19 closed 4 years ago

ParanoidAndroid19 commented 4 years ago

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: res1

Any help would be appreciated!

ParanoidAndroid19 commented 4 years ago

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.