T
TanStack•5mo ago
absent-sapphire

Precautions I should have when using Router + Query?

Hi everyone, I have a project that uses TanStack Query and React Router, with all my network calls going through Query. I'm currently migrating to TanStack Router and following the documentation. During this process, I came across createRootRouteWithContext as opposed to createRootRoute, but I'm not sure about the differences or when I should use one versus the other. This also makes me wonder if there are any other details I could be missing when doing such a migration. Are there any specific considerations I should keep in mind for a smooth transition from React Router to TanStack Router? Thanks in advance for your help! :tanstack:
1 Reply
deep-jade
deep-jade•5mo ago
If you just get started i recommend using @tanstack/react-router-with-query so query and router work together out of the box 🙂 it is not documented but recommended: https://discord.com/channels/719702312431386674/1357110437610782841/1357316888216211496 TSR has no concept of a "handle". if you used that a lot in RR6, we mostly moved it to the context method of each route instead.

Did you find this page helpful?