Look at this component: https://github.com/ShaderFrog/editor/blob/main/src/editor/components/Editor.tsx
The body of this component is around 2,000 lines long. Any single change to the graph, like:
- Dragging a node around
- Dragging a slider in a node's UI, modifying its custom value
Causes this top level Editor.tsx component to re-render, because the Editor needs to know about the graph.
This is in a 60fps webGL editor, and any graph change tanks that because the Editor re-renders.
Most of the state is in Zustand, but because the top level component needs to know about the graph, it still re-renders on every graph change.
What can I do here?