projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.45k stars 1.16k forks source link

Demos should be refactored to be consistent with modern react standards and styles #1006

Open Cpt-Falcon opened 1 year ago

Cpt-Falcon commented 1 year ago

Demos are still using very old class style components

kilotone commented 7 months ago

Might benefit from using state/effect and custom hooks as well. I extended custom components using react fc and some material and joyui components, was fairly straightforward, but adding custom hooks would really shine for the equivalent of useModel, useSerialize useFlowState, and useDiagramTransition.

kilotone commented 6 months ago

I was able to mostly migrate to functional components and hooks, the only problems seemed to be the class components use of force update calls, and some dangerously set innerhtml. I can submit a pr if there's interest.