TanStack

T

TanStack

TanStack is a community of passionate software engineers striving for high-quality, open-source software for web devs

Join

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

fascinating-indigo
fascinating-indigo8/8/2025

What is params={true} in a Link component?

This property is used in the Kitchen Sink examples in the docs, but I can't find documentation on params as a boolean. ```jsx React.useEffect(() => { navigate({...
manual-pink
manual-pink8/8/2025

Is it possible to provide a manual name for the chunk(s) emitted for a code split route? (with Vite)

I'm considering the possibility of conditionally allowing access to certain parts of the bundle via middleware but I would need a way to reliably identify what the chunk contains by its name. Is this currently possible or is it a feature that might be considered?
foreign-sapphire
foreign-sapphire8/8/2025

Remove tailing /

Is it possible to make routes with wildcards dont show the last / if the splat is undefined? Lets say i have the route /search/$.tsx if i do ``` navigate({...
molecular-blue
molecular-blue8/7/2025

router.invalidate() doesn't refresh the data from Route.useLoaderData()

New to tanstack router, so I might be missing something. I have a loader on a Route that returns some data from context (e.g. auth data/logged in user). When I update the context and invalidate the router (using router.invalidate()), the TanStackRouterDevtools show the new data is in the context, and when I navigate to a new route the new data is displayed, but the data from Route.useLoaderData() isn't refreshed/updated (without a refresh or a navigation to then back to the page)
fascinating-indigo
fascinating-indigo8/7/2025

Understanding Route loader query vs component hook query

Can anyone help me to understand the difference between executing a query in the loader vs in the component? I have these two examples ```javascript //$id.edit.tsx...
other-emerald
other-emerald8/6/2025

Problem with displaying child routes in the Outlet

Hi, I've ran into a problem, where my child routes instead of displaying in the place of the Outlet, just display as a whole new page. I have a dashboard and I want to display content of for e.g settings next to the sidebar, but instead the settings route displays without the sidebar. My file structure: ``` /dashboard index.tsx - main dashboard component with a sidebar...
ratty-blush
ratty-blush8/6/2025

Is TanStack Router with SSR as good for SEO as Next.js?

Hey everyone, I’m trying to decide between using Next.js and TanStack Router (with SSR) for my project. Here’s my situation:...
eastern-cyan
eastern-cyan8/6/2025

Route Path in `createFileRoute` Keeps Auto-Correcting to Remove Layout Folder

Hi all,
I’m running into an issue with TanStack Router’s file-based routing. My file structure is: ``` src/routes/...
national-gold
national-gold8/5/2025

Router defining root route as parent route for all file routes

Is there any known reason/quick fix as to why when I create new file routes with nested routes in them it would default the parent route to be the root route rather than the immediate parent route? Is that something I have to configure? For example, I have sales/invoices, sales/invoices/new, sales/invoices/$invoiceId...
metropolitan-bronze
metropolitan-bronze8/5/2025

Breadcrumbs solution requiring 3 files per component?!

I created a working bizarre solution for breadcrumbs, see live minimal example: https://stackblitz.com/edit/tanstack-router-y2cazlrs?file=src%2Froutes%2Fsettings%2Fall-users%2Fedit%2F%24id%2Findex.lazy.tsx,src%2Froutes%2Fsettings%2Fall-users%2Fedit%2F%24id%2Findex.tsx,src%2Froutes%2F__root.tsx,src%2Froutes%2Fsettings%2Fall-users%2Findex.tsx,src%2Froutes%2Fsettings%2Fall-users%2Froute.tsx,src%2Froutes%2Fsettings%2Fall-users%2Fedit%2F%24id%2Froute.tsx,src%2Froutes%2Fsettings%2Fall-users%2Findex.lazy.tsx,src%2Fmain.tsx however in order to support lazy loading, static data, beforeLoad for crumb title and using the Matches pattern in official example I had to have 3 files per route. Any other more reasonable solution made something break. What am i doing wrong? how can i bring this down to 2 files per component?...
foreign-sapphire
foreign-sapphire8/3/2025

Redirecting /admin/ to /admin/displays

Hi guys, quick question, but first a bit of context. I'm using admin.tsx as a layout route. admin.index.tsx is just a placeholder since the real entry point for /admin is admin.displays.tsx. I want to redirect /admin/ to /admin/display. Is it okay to just add a loader in admin.index.tsx for the redirect, or is there a cleaner way to handle this in TanStack Router? ```...
absent-sapphire
absent-sapphire8/3/2025

Tanstack Start using solid and Tauri

Tauri only support spa mode. My vite plugin, ``` plugins: [ tsConfigPaths(),...
like-gold
like-gold8/1/2025

`loader` runs on every transition despite `loaderDeps` usage

Hey all 👋 Can someone help clarify how the loader in TanStack Router works? From what I’ve observed, it seems to run on every successful route transition — even when only a minor search param changes. I tried using loaderDeps, which I assumed would act as the dependency list for when the loader should re-run, but it still re-executes on every change. ...
stormy-gold
stormy-gold7/31/2025

Search-Typing issue

Hey 👋🏽 . I love tanstack router. Does somebody know why following works: ```ts import { createFileRoute } from "@tanstack/react-router";...
correct-apricot
correct-apricot7/31/2025

Google Tag Manager

Did someone manage to add Google Tag Manager on his Router/Start application?
quickest-silver
quickest-silver7/31/2025

How to infer the type of Route component with the context of it?

Let's say I have this component: ``` import { createFileRoute } from "@tanstack/react-router"; ...
ratty-blush
ratty-blush7/31/2025

createRootRouterWithContext Interface cannot be Named Type Issue

Heylo, I've tried implementing createRootRouterWithContext with an interface, but I run into the following issue when defining my router:
Exported variable 'router' has or is using name 'MyRouterContext' from external module "../routes/__root" but cannot be named. (ts 4023)
Exported variable 'router' has or is using name 'MyRouterContext' from external module "../routes/__root" but cannot be named. (ts 4023)
...
sunny-green
sunny-green7/30/2025

Is it okay to use `CatchBoundary` component as a generic error boundary component?

Referring to https://tanstack.com/router/v1/docs/framework/react/api/router/catchBoundaryComponent I'll eventually be setting up Sentry to use their error boundary in most cases, but for cases where I'm handling known errors, I was wondering if CatchBoundary is safe to use as opposed to using something like react-error-boundary...
sensitive-blue
sensitive-blue7/30/2025

@tanstack/react-router streaming ssr

Hello, Im trying out this example https://github.com/TanStack/router/blob/main/examples/react/basic-ssr-streaming-file-based/vite.config.ts my question is it necessary to build for both client and server? and why is this happening?...