react query vs redux toolkit query
Hello,
I would like to have your advices about my application.
It is a global application with 4 independants apps. It looks like if you Want a monorepo.
For 2 of them which are built from scratch, I decided to use react query. Some fetching data and mutations for both.
At the end, react query was a good choice. Thank you for this amazing tool by the way.
For the last two applications, they have already redux + redux observable.
I wanted to remove all the observable boilerplate and I took a lot of Times for choosing between react query and redux toolkit.
I finally decided to use rtk query because the existing apps already used redux.
I thought about removing redux but the question wasn't easy AT all.
So i decided to have in the same repo react query for two apps and rtk query for the rest.
I know that there are pro and cons. I read a lot or articles and It IS apparently ok to combine react query and rtk query.
What are your thoughts about that ? Did I make a mistake by choosing rtk query over react query ?
Note that yes, the first Idea was to remove redux observable. That's why rtk query came to my mind because it is very similar to react query.
Thank you very much for your help ! Cc @Tanner Linsley 😉 @TkDodo 🔮
7 Replies
ambitious-aqua•3y ago
Any concrete question?
exotic-emeraldOP•3y ago
My question is : is it a good Idea to combine both react query and redux toolkit on an application ? I read pros and cons and need your external point of view about using both
ambitious-aqua•3y ago
I am in a big project with both and it is a huge pain as it is hard to know how a given resource can be accessed as two state managers compete over the resources
exotic-emeraldOP•3y ago
Ok but if the apps are independant, would it be possible ?
ambitious-aqua•3y ago
Yes
exotic-emeraldOP•3y ago
Which state managements do you use by the way ?
ambitious-aqua•3y ago
We are employing jotai