State management
I’m curious if there are thoughts of integrating some sort of state management framework?
5 Replies
Right now we are using react-query under the hood.
What did you have in mind?
You could add any state management library as a dependency though. I personally have never needed anything more than react-query and react context
Sure thing - you could add and use e.g. redux or zustand if you needed explicit loxal state management.
Wasp is by default using react-query, which is pretty simpler to use and we add a lot of niceties on top, such as automatic cache invalidation, support for optimistic updates etc. For some local only stuff you'd typically use react context.
Cool, I completely missed that, didn’t realize that was a state management component, thank you!
From our research / experience, react-query + React Context actually work very well for 90% of the apps.
Further than that, adding something like Redux or Zustand probably makes sense, and that should be doable for sure. We don't have any integrations per se yet, but we might add them in the future if we see the need for it. Do let us know if you have any ideas on this topic! Personally, I mostly used Redux in the past, and recently react-query. (tanstack-query).
Perfect, thank you.