I use Redux in my React apps for one and only one purpose: to store in app memory the JWT when handling authentication (because saving it in local storage would be madness). And I chose Redux because it was very popular a few years ago.
I also use React Context to store app wide config info like theming, language. However I do not use any other "global" state, react-query is more than enough for displaying API results in the frontend.
Of course. But I wanted decoupled from my app state because I can reuse this principle for other apps that do not use React. It never actually happened until now but that's what I thought when I decided to use Redux: to keep things completely separated.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I use Redux in my React apps for one and only one purpose: to store in app memory the JWT when handling authentication (because saving it in local storage would be madness). And I chose Redux because it was very popular a few years ago.
I also use React Context to store app wide config info like theming, language. However I do not use any other "global" state,
react-query
is more than enough for displaying API results in the frontend.Cheers!
Use what makes you happy,
after all, you'll be the one debugging when anything goes wrong in your app
Hey Victor, great post !
It sounds like you don't need redux 🤔
That may be true, but what else? I need something non persistent to store some app state and I believe Redux is just that: a state container
You can put it with the rest of your app state, or send it through another context provider.
Of course. But I wanted decoupled from my app state because I can reuse this principle for other apps that do not use React. It never actually happened until now but that's what I thought when I decided to use Redux: to keep things completely separated.