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

united-yellow
united-yellow11/30/2024

Clearing search params does not work on mount?

I have a search params validation when i get ids of some stuff, then in the component i get this ids from useSearch and check if this ids exist in API resposone. if yes i keep the search params and do other actions if no i wanna clear the params ...
united-yellow
united-yellow11/29/2024

How to reset search params when not validated?

How to completly clear search params when not passed validation? heres my validation: ```js...
adverse-sapphire
adverse-sapphire11/29/2024

How to differentiate between navigation from other page, and a full page refresh?

Is there a way to detect the difference between a page load after navigating from another page, or a page load from a full page refresh? They both have cause: enter, and I haven't found any other mechanism I can use for this either. I intend to use it to control whether to scroll an element into view or not....
flat-fuchsia
flat-fuchsia11/29/2024

Typescript don`t work

Guys, is anyone know how to fix this problem? I created new vite React + Typescript project started to setting up tanstack router by getting started guide, but when i added file index.lazy.tsx in routes folder I see an error. And typization for navigation also don't work. Can someone help me with this issue?
No description
optimistic-gold
optimistic-gold11/29/2024

Start with static pre-rendering but no need ssr

Like the title, I want to use Static Pre-rendering for landing and first couple of pages such as login, signup page. After that, I only want Client side rendering since it may needs dashboard fee like some complex UI changes, so guess no need SSR. I wish I can create Static pre-rendered site for the first couple of pages with only Tanstack router, but seems not supporting on there. Does SSR is by default in Tanstack Start? I wish I could deploy to AWS S3 with the couple of static sites and SPA a...
ambitious-aqua
ambitious-aqua11/28/2024

Dynamic breadcrumbs

How can I create dynamic breadcrumbs? I’m trying to use router state with matches, but it deletes the history. E.g.: Home -> User -> Settings, but you can also reach settings from Home -> Settings. Is this possible in a simple way? Or do I need to push/pop into a breadcrumb array which I keep in the context?...
genetic-orange
genetic-orange11/28/2024

Can't Use `useSearch` in Reusable Component Across Multiple Routes

I'm having trouble using useSearch in a reusable component when working with multiple routes in a TanStack Router project. Here's a breakdown of the issue: Code Example The Reusable Component: ```tsx...
extended-salmon
extended-salmon11/27/2024

Mocking/stubbing dynamic path params in storybook stories.

I'm trying to use tanstack-router with vite, react and storybook. I have file-based routing setup and working on my react app, but having issues with dynamic path params in my stories. Ex. /organizations/$organizationId renders a component: ViewOrganization which then pulls organizationId from useParams({ from: "/organizations/$organizationId" });
And I have a decorator creating a memory router for storybook. This works for non-dynamic routes....
fascinating-indigo
fascinating-indigo11/27/2024

Prevent errorComponent on non-critical loader failure

Hi. Not sure if my title is very clear, sorry English is not my first language. So, in my case, in a route loader, I fetch some data but there are not mandatory for the page. Instead of an errorComponent blocking all my page, I would prefer to show my page and handle the error in it for just this part. I did this : ```tsx...
stormy-gold
stormy-gold11/27/2024

How to create multiple routes with createFileLazyRoute e.g. / and /page/$page & <Suspense>

My goal is a single component that handles / and /page/$page I tried the following, but when I save it it removes the (page/$page?) from the createLazyFileRoute... I'd prefer to not have to create a separate lazy route if at all possible ```import PostCard from "@/components/PostCard";...
xenial-black
xenial-black11/27/2024

Routes with specific search params validator

How would I got about defining a type that accepts any of my routes, but with a specific search params valdidator? I use Zod for the validator if that matters.
dependent-tan
dependent-tan11/27/2024

Multi Tenant Setup in TSS

I am currently exploring TanStack Start and would like to implement a multi-tenant architecture. While I assume this should be feasible using Nitro proxies, I haven't been able to figure out the correct approach or configuration. Would it be possible to provide an official guide, example, or even documentation on how to set up a multi-tenant system with TanStack Start? This addition would greatly benefit developers looking to adopt TanStack Start for SaaS applications or projects requiring multi-tenancy....
passive-yellow
passive-yellow11/25/2024

TanStack Router Course

Hi there everyone, do you where I can find a TanStack Router course?
silky-coral
silky-coral11/25/2024

Nested dynamic routes

Hello, Is it possible to have one Route be able to match nested dynamic routes? I would like '/profile/$userID/$tabID/$subTabID' to be reachable via any sub-sebsequence (e.g. '/profile', '/profile/$userID'). I tried building out this folder structure but couldn't get the inner routes to match...
eastern-cyan
eastern-cyan11/25/2024

Stale data loading with ensureQueryData and useSuspenseQuery

in the docs there is this example about data loading ```ts const postsQueryOptions = queryOptions({ queryKey: ['posts'], queryFn: () => fetchPosts(),...
xenial-black
xenial-black11/25/2024

TS error in the beforeLoad example (throwing the wrong type)

Hello, I have a TS error with this example : https://tanstack.com/router/v1/docs/framework/react/guide/authenticated-routes#redirecting The error is located at throw redirect({ to: '/login' }); The error is :...
wise-white
wise-white11/25/2024

Link component always returns `isActive` `true`

Hi all 👋🏼 Version: 0.0.1-beta.53 I'm using the Link component but they all return true for isActive:...
firm-tan
firm-tan11/25/2024

suspend until resources are fully loaded

Hi everyone, I'm using tanstack start is there a hook where I can load images and fonts and suspend until those are fully loaded before showing the component...
absent-sapphire
absent-sapphire11/24/2024

Route “fragments”

I work in a monorepo that has lots of apps. Today, each app is responsible for managing its own routes (not using ts router today). We have a top level platform package that imports components/ routes from each package and composes them together. I’m very close to accomplishing this with tanstack router, however the restriction that a root route must be defined is making this very difficult because composing N apps together means there will be N root routes. I don’t know if this is possible or on the road map anywhere but it would be extremely nice to define a group of routes that are meant to be exported and consumed by a root route defined somewhere else. I can sort of accomplish this with virtual routes but there are other tradeoffs....
extended-salmon
extended-salmon11/24/2024

About route groups/layouts with different wrapper layouts

Hey Router people! I am currently experimenting with converting a Next.js project that has the following routing (example): Grouped under (main) and has its own layout.tsx in the Next.js world. Let's say this layout renders a header - /...