Closed Livshind15 closed 4 years ago
Yes I was experiencing the same issue. When structuring my components differently from the examples, the on Node Dropped event is called 2 times.
What do you suggest the solution to this is?
@MrBlenny
Experiencing the same issue. it creates two nodes with different IDs.
@MrBlenny I noticed the error occurring when I started to useContext() for the state of my graph according to this example. https://codesandbox.io/embed/condescending-moon-jke7z
When I used this model for the state of the graph, I couldn't figure out how to update the state of the graph from the node, but I did not experience this error. https://github.com/MrBlenny/react-flow-chart/blob/master/stories/CustomNodeInner.tsx
because of React.StrictMode setState updaters will run twice in strict mode in development, This causes a double call to onCanvasDrop function and create double node