Replies: 1 comment 1 reply
-
|
I had the same problem when I started using one store instead of multiple. I recently made zustand-tracked to improve performance. It basically only recomputes the selector when it needs to. It sounds like you could use 'createTrackedWithEqualityFn' which also allows for result comparison to reduce rerenders. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm currently using a single Zustand store because I previously tried splitting state into multiple stores, but found it difficult to manage inter-store dependencies — especially when one store's state relies on another. This approach also aligns with Zustand’s official recommendation for single store.
However, I'm now facing performance and complexity issues due to nested and cross-dependent state. Here's an example selector I use to derive
openedFileNodes:This selector is:
My question:
Are there best practices for:
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions