State management

I’m curious if there are thoughts of integrating some sort of state management framework?
5 Replies
Vinny (@Wasp)
Vinny (@Wasp)2y ago
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
matijash
matijash2y ago
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.
RufusRed
RufusRed2y ago
Cool, I completely missed that, didn’t realize that was a state management component, thank you!
martinsos
martinsos2y ago
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).
RufusRed
RufusRed2y ago
Perfect, thank you.
Want results from more Discord servers?
Add your server