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

foreign-sapphire
foreign-sapphire10/21/2025

SSG

https://x.com/tannerlinsley/status/1887914853215649947 How can I do static site generation (html files) when deplyong to Vercel? I'm aware of this https://tanstack.com/start/latest/docs/framework/react/guide/static-prerendering but it seems to only work when I do NOT use the nitro plugin on vite.config.ts...
fair-rose
fair-rose10/20/2025

Shared context for a route and its children.

Hi, this might be a stupid question but i am kinda lost. Is there a way i can pass the MenuID to my page that is within the layout? I am looking for a TanStack router way of doing so. My global context. ``` export const Route = createRootRouteWithContext<{...
passive-yellow
passive-yellow10/20/2025

view transitions dont work on common layout parts of a page during transition

i have a side bar that has different content depending on the route ```typescript function SidebarLayout({ children }: { children: React.ReactNode }) { const pathname = useLocation().pathname;...
wise-white
wise-white10/20/2025

Access another route's loader data

Is it possible to get another route's loader data? E.g. I'm on a product list page, I want to show links to products and I want some data from the product page's loader
grumpy-cyan
grumpy-cyan10/20/2025

Access path params in head function

For some reason accessing path params in my head function, in order to set the title, causes weird TS errors. If I remove the quotes, to this title: params.slug, I get this error on the head function...
No description
yelping-magenta
yelping-magenta10/17/2025

Show 404 when navigating to a route without index.tsx

Since the route /ag has only a layout without an index.tsx, accessing it should throw a 404, but instead I'm able to access it and it just shows a blank page. Is this intended behaviour and how do I fix it?...
No description
conscious-sapphire
conscious-sapphire10/17/2025

Path params without route

Hi, Wasn't sure how to explain it shortly but essentially i have this file books.$bookId.pages.$pageNum.tsx and this route should work only as is. So books.$bookId should redirect to 404 page (or to the first page - books.$bookId.pages.1.tsx) Plus, how do I parse bookId and pageNum as number and where exactly should i parse it? ...
ambitious-aqua
ambitious-aqua10/17/2025

How to return a custom status code in a route handler?

I wish to respond to an invalid URL query parameter value with a 400 status code. As I understand, returning a custom HTTP status code in a route loader is not possible due to prerendering. But what I’m struggling to understand is how is something like notFound() able to be implemented?
genetic-orange
genetic-orange10/16/2025

Do _pathlessLayouts allow dynamic routes for protected children routes?

Hey all I am new to ts-router, quick question I remember reading in the docs that a pathless layout like _dashboard/ can’t have dynamic routes as children (e.g. _dashboard/$postId.tsx), and you’d have to do something like $postId/_dashboard/.... But what if I use _authenticated/ to protect routes — would _authenticated/dashboard/users/$userId.tsx still work?...
fair-rose
fair-rose10/16/2025

How to Avoid Hardcoding Paths when Navigating to other Routes

In my web application, there are many places where I need to navigate to another route. I am looking to figure out how to pull route paths from Tanstack router so I can avoid having to hardcode them throughout my application. For instance, on the main view of a Blog page (/blog) I might have links to the following: 1. Viewing individual blog posts -- /blog/posts/$id...
fair-rose
fair-rose10/16/2025

.lazy() on a Route, with an error component is not displayed in case of error

Hey folks 👋 I want to check first here if it's a bug or a miscomprehension from me on the .lazy() api. If I have two routes:...
deep-jade
deep-jade10/15/2025

Blank white page error

am i doing something wrong? ```tsx import { createFileRoute, redirect, notFound,...
No description
afraid-scarlet
afraid-scarlet10/15/2025

CSR/SSR/Prerendering per route

How can I create an application that combines all these renderings and defines them per route? For example, I have the following routes: - /: this must be prerendered since it is the home page - /app/* everything inside of /app must be CSR, like a SPA...
ratty-blush
ratty-blush10/15/2025

Not fully successful with Supabase Github OAuth completion

Supabase Github OAuth is configured, and the user information is obtained after login and written into supabase. However, after redirecting to the homepage, supabase.auth.getUser() does not get the user information. Email login is fine. Can anyone help me figure out what's wrong? The code is in the screenshot....
No description
fascinating-indigo
fascinating-indigo10/14/2025

Enable viewTransition on router.history.back()

Hi folks, I am using the defaultViewTransitions=false on my createTanStackRouter, as i want to be able to enable view transition for specific transitions only. At a case, i am using it on a <Link>, but also need to use on the way back (router.history.back()). Why router.history.back() ? Because its a gallery and i want to restore scroll position on where the user was on the page before navigate to the item page....
evident-indigo
evident-indigo10/14/2025

Removing search params when leaving page

Is there a way to remove a search parameter when navigating away from a page? I have a page that accepts the search parameter sortBy=something. When the user navigates to another page that also supports a sortBy parameter (but with different valid values), I want to ensure that the sortBy parameter is removed so it can fall back to the default value on the new page. I tried setting strict = true in the router configuration, but since both pages accept sortBy, the parameter isn’t removed....
generous-apricot
generous-apricot10/14/2025

Tanstack Start + fumadocs

Does anyone know if its possible to deploy fumadocs on tanstack start statically without lamdas or servers or SSR? I am just getting started with that tech but I want to learn how to use Start. Being about to statically deploy fumadocs seems lke a big win for a small docs site.
quickest-silver
quickest-silver10/14/2025

React transition support?

https://github.com/TanStack/router/discussions/289 Hi, I was surprised to find out that tanstack router doesn't support react transition while navigating between routes. I know that we can use loader to preload but additional transition support would be useful. ...
harsh-harlequin
harsh-harlequin10/13/2025

Invariant failed: Could not find an active match from <route> when DevTools gives match to URL

I'm trying to define a dynamic route segment with code-based routing, but I get this error where the logs say it can't find an active match, but Tanstack Router Dev Tools gives me the expected route component under matches. Am I missing someting? This is my first time working with Tanstack Router. I can provide further context/code in this thread, if necessary...
No description
absent-sapphire
absent-sapphire10/13/2025

createRoute context argument still any despite AnyRouteWithContext<TestContext>

I'm trying to make sure my route has proper context typing instead of any. I have lots of routes and I'd like context to be available. I have this setup: ```tsx import {...