react-query-questions
solid-query-questions
table-questions
virtual-questions
router-questions
react-charts-questions
ranger-questions
vue-query-questions
svelte-query-questions
bling-questions
form-questions
angular-query-questions
start-questions
db-questions
start-showcase
router-showcase
📣-announcements
How to prevent router from breaking mantine styles
Need help with Breadcrumb component using Shadcn UI and Tanstack Router
Looking to animate my route changes (fade-to-black type thing)
Why might search be persisted through navigation?
navigate({ to: '/some-place' }) (from useNavigate())? I cannot for the life of me figure out why, since the default behavior seems to be to clear the search items when navigate() is called even without explicit search: {}. In my case, explicitly calling navigate({ to: '/some-place', search: {} }) does not work--the search string is carried through. I cannot unfortunately reproduce this in a sample project...Delay in loading component with tanstack lazy loading
useParams typescript error
const someId =
useParams({ strict: false })?.someId || props.someId;
const someId =
useParams({ strict: false })?.someId || props.someId;
<Link> in RouterContextProvider doesn't navigate to link
@tanstack/react-router. I'm trying to create a <Link> between two of these packages. Since package A does not know of the existance of package B, I'm wrapping the URL in a <RouterContextProvider> with the router being the router in the other package. All is well so far; I get the correct suggestions now and everything seems like it works.
Problem now is, when clicking the link in the browser, the URL in the browser actually gets changed to the correct one, but the browser never navigates away from the page. Is this something I am doing wrong? The <a> in the browser has all the correct attributes, so I'm kinda confused here....'rules-of-hooks' ESLint rule conflicts with inline route components
plugin-hooks/recommended is used, the following code causes an ESLint error:const Route = createRoute({
component: () => {
useState() // React Hook "useState" is called in function "component" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". eslintreact-hooks/rules-of-hooks
const Route = createRoute({
component: () => {
useState() // React Hook "useState" is called in function "component" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use". eslintreact-hooks/rules-of-hooks
Abort preload when navigating to different route
queryClient.ensureQueryData. This loader is triggered with I hover over the Link component (because of the preload functionality).
```tsx
......TanStack Router Docs Wrong? - Auth Example

Updated routes broke my application.
routeTree.gen.ts to regenerate it....
Do you typically put route components inline or import external components ?
Loading data in router using tanstack-query but need api token from react hook
loader method. However, my scenario is that accessing my API server requires a JWT token and the only method I have available for that is a react hook. Since the loader isn't a react component, I can't straightforwardly call my getToken() method from there.
I'm keen on being able to do this so if anyone has any suggestions I'd appreciate hearing them. For one thing, I'd need this in order to do any data loading via the router. For another, my current use case is that I need to load data in the router so that I can dynamically populate my breadcrumb trail. The idea is that when accessing the path /entity/{id}, the router can look up the relevant entity by its id and display e.g. its name or title in the breadcrumb trail. In principle, this can work (see e.g. https://github.com/TanStack/router/discussions/895). But not being able to access the getToken() method is currently preventing me from doing this in the most obvious way.
For context, I'm using axios to handle my API calls and I have a useEffect() in my root route (routes/__root.tsx) which adds an interceptor to my axios instance which calls getToken() and then adds it to the axios request as an authorization header. This works for regular uses of useQuery within my react components and pages. But I can't figure out how to make it work in the router's loader method. Any ideas would be much appreciated!...How to get route context correctly typed?
match.routeContext gets its type? I was reading the documentation about "Processing Accumulated Route Context" and from my understanding the type should extend the Router Context defined in createRootRouteWithContext. But I get an error if I try to access the properties that I define in Router Context. Should I define the correct type somewhere else?
Edit: I made a codesandbox...
getting issue with pending component
possibility to check if can go back
Nested route group navigation
How to configure router with queryClient in context?