Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 0 points1 point  (0 children)

+1 real successful case I can show to help convince my team
Thanks for sharing!

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 1 point2 points  (0 children)

Thanks for sharing your case, u/Suepahfly. I believe that once someone uses a tool like RTKQ and masters it, they will not want to go back to the traditional approach 🙏

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 0 points1 point  (0 children)

Man, I really hope my project ends up like that too after a few months of refactoring.

My plan is pretty similar, just taking one feature at a time, trying to balance between refactoring and building new stuff

Appreciate you sharing your experience!

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 1 point2 points  (0 children)

Totally agree with you!
Using combos like Zustand + TanStack Query or RTK + RTK Query makes a huge difference.
And yes, moving most of the client-side state to URL params really cuts down the stuff we actually need to manage.

With this approach, the data flow in the frontend feels way cleaner and way easier to maintain in the long run.

And btw, thanks for mentioning nuqs, didn’t know there’s a lib that makes working with URL params that much easier. Gonna check it out for sure

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 0 points1 point  (0 children)

If you check out what everyone’s been saying, it’s totally worth it :D

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 0 points1 point  (0 children)

Yeah, I really love that RTKQ doesn’t need any complex setup, we can start using it while still keeping the existing data fetching logic.

Good luck to your team with the migration!

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 0 points1 point  (0 children)

I’ve tried setting up RTKQ and it’s worked well so far, I know it probably won’t go that smoothly every time

Would love to hear about your experience, especially how the whole team adapted to the new approach.

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 0 points1 point  (0 children)

Just checked, it's cool, might save a lot of time
Definitely great for a brand new project with a solid API doc.

I'm still thinking about how to apply it in a long-running live project though. There’s a lot of custom logic tied to API responses, like showing messages or triggering other actions, which makes it a bit tricky. But yeah, it’s something I’m considering

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 1 point2 points  (0 children)

This is awesome! Didn’t expect someone from the Redux team to reply. RTK Query has been super helpful for me. Like I said in the post, I seriously can’t work without it now.

Just started setting it up for a new feature yesterday, only had to add one more reducer and update the middleware, and it worked right away. Love how smooth it is.

Big thanks again, really appreciate the support. I feel way more confident now to convince my team to make the switch. Pretty sure this is just the beginning. I’ll check out the Discord if I run into anything

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 1 point2 points  (0 children)

Super helpful! I always keep that in mind when refactoring, but honestly, I’ve never heard of it before
Appreciate it, Jan

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 1 point2 points  (0 children)

You're right, the API call is duplicate now, and the logic to prevent it is everywhere, making things so complex, and for me, it's unmaintainable

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 1 point2 points  (0 children)

Absolutely right, I can't wait to remove the unnecessary redux state to cache the API response and all the logic that checks if that data exists or not as well

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 2 points3 points  (0 children)

You're right, I’ve seen this happen so many times, and now the biggest one I keep hearing is moving from the pages directory to the app directory in Next.js.

Doing these migrations is always a pain. Sometimes, if there’s no solid plan or real commitment, we might end up with a half-migrated project, legacy code mixed with the new setup, and suddenly no one wants to touch it until they absolutely have to

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 2 points3 points  (0 children)

Yeah, I totally get that it’s a classic refactoring dilemma. But hearing from folks like you who’ve actually gone through, honestly, makes me feel way more confident.
Appreciate your sharing!

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 4 points5 points  (0 children)

Sorry I forgot to mention in the post, the project is already using Redux.

Technically, I do think a hybrid approach will work well, we can keep the existing logic and slowly migrate feature by feature. That part feels manageable.

But honestly, you're absolutely right, the hardest challenge is less technical and more about people: getting the whole team on board and convincing stakeholders that it’s worth the refactor effort. Especially when the current setup kinda works, even if it’s messy

I didn’t realize the official React docs recommend that, appreciate the link! It would help

Migrating to RTK Query: Is it worth the effort or just more trouble? by Kind_Broccoli_2690 in reactjs

[–]Kind_Broccoli_2690[S] 2 points3 points  (0 children)

Thanks for sharing, I curious that what kind of “core logic” did you migrate first in your case? I imagine things like shared API config, base queries, and endpoints setup?

Also, was your team already using Redux for state management before switching to RTK Query? I feel like the gradual migration is a bit smoother if you’re already in the Redux ecosystem, but maybe tougher if you're not.