I'm using shadow-cljs and re-rendering on file save. Is there a way to preserve component state between renders?
I've tried a few things without luck:
- Writing a mixin that stores any atoms in state. The problem is that it's hard to get a unique key for a component that persists between renders
- Wrapping the render with a functional component that contains a ref. I think React maintains this ref if fast-refresh is enabled, but that doesn't seem to work here.
Any other ideas on generating an id or signature that is unique to a component's position in the render tree would be appreciated!