Router Loaders and/or Query
Hey all, by reading the docs about data loading using react router (https://tanstack.com/router/v1/docs/guide/data-loading#tanstack-loaders), one thing that still not clear to me is if there's any reasons to add a new lib like Tanstack query for data caching and etc or if Router Loaders already does that. Is there any reason/benefit on using Tanstack query with Tanstack Router? Or Tanstack Loaders covers it all?
Data Loading | TanStack Router Docs
Data loading is a common concern for web applications and is extremely related to routing. When loading any page for your app, it's ideal if all of the async requirements for those routes are fetched and fulfilled as early as possible and in parallel. The router is the best place to coordinate all of these async dependencies as it's usually the...
2 Replies
deep-jade•3y ago
equal-jade•3y ago
I suspect this will be a very common early question for folks who are familiar with tanstack and taking a look at router for the first time :).