I’m having trouble with undo manager and remembering history when a component is unmounted / remounted. I’ve included some example code based off of the gojs-react-basic code: Test undo / redo w/ unmount by scottdover · Pull Request #13 · NorthwoodsSoftware/gojs-react-basic · GitHub (I tried to highlight the relevant bits that changed in the PR, since my ide auto-formatted a bunch of things).
If I unmount & remount a diagram, the history information is lost. I’ve also attempted to call
this.diagramRef.current.clear() on unmount, and alter
initDiagram such that it returns a previously created diagram on remount.
I’m wondering if something else needs to happen to make sure history is maintained even when diagrams move off the screen?