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

equal-aqua
equal-aqua9/17/2024

Tanstack Start attempting to run the build fails

Hi everyone, I am working on an app using Tanstack Start. I followed the setup instructions here: https://tanstack.com/router/latest/docs/framework/react/start/getting-started I noticed that running the dev, and build commands (vinxi dev and vinxi build) run fine, however attempting to run vinxi start after a build causes the error reported on this issue: ...
fascinating-indigo
fascinating-indigo9/17/2024

Retrieve some routes from all flatRoutes

Hello, I would like to retrieve some routes with a precise staticData. Could you please tell me how to do that? For the moment, I'm trying to retrieve the flatRoutes from the useRouter method, then trying to apply a match but doesn't succeed.. Thanks!...
other-emerald
other-emerald9/17/2024

Wont navigate away me after successfull sign in

i am using protected rotues with context but my problem is after i sign in state change to true but wont navigate me to page. ``` function App() { const auth = useAuth(); if (auth.isLoading) {...
No description
absent-sapphire
absent-sapphire9/16/2024

Suggestions for a dark/light mode theme selector

Is there something like remix-themes / next-themes for tanstack start for using the client system theme without flashing? I'm using shadcn and hoping for class based theming (adding dark class to root element)
old-apricot
old-apricot9/16/2024

Path aliases with tanstack start? (SOLVED)

Hello! im trying to prerender my app using tanstack start, i added the config found in the example: ```import { defineConfig } from '@tanstack/start/config' export default defineConfig({ deployment: {...
rare-sapphire
rare-sapphire9/15/2024

Is colocation of code possible in route directory

If I'm understanding docs correctly it's not possible to colocate any other components in the route directory with the route. Every file turns into a route. I suppose it's possible with virtual file routing but not file / directory routing? This seems like a big problem because colocating one-off components for a specific page is really nice.
adverse-sapphire
adverse-sapphire9/15/2024

Breaking parent layout inheritance

Hi everyone, I'm using file-based routing and have the following structure: ```...
stormy-gold
stormy-gold9/13/2024

Pending component not showing on beforeLoad on rootRoute

It seems that if you do a beforeLoad on the root route it doesn't render the pending component. Is this intended ? https://stackblitz.com/edit/tanstack-router-4kxhzc?file=app%2Froutes%2F__root.tsx&preset=node...
xenial-black
xenial-black9/13/2024

How to get a dynamic route path without the dynamic part?

What I mean by that is, how can I get something like "users/$userId" and not "users/123"?
conscious-sapphire
conscious-sapphire9/12/2024

Relay

Does anyone use Relay and the Entrypoint pattern? I'm currently using react router with https://github.com/loop-payments/react-router-relay, i want to test using tanstack router since react router has unnecessary re-renders that impact my app (has 3d visualizations so rerenders are pain) (https://github.com/remix-run/react-router/issues/7634). This is all i found https://github.com/TanStack/router/discussions/807, I suspect its possible but just checking first...
foreign-sapphire
foreign-sapphire9/12/2024

Trying to set up global context and running into errors

I'm sure my inability to figure this out is due to being very new at this but I just can't figure out what exactly I am missing here. I get errors you can see at the following Gist... https://gist.github.com/Dave-Wagner/ab444330743318b1d44e41f161d4fe78 If anyone can take a look and just point me in the right direction I'd highly appreciate it....
rare-sapphire
rare-sapphire9/12/2024

Possible to make child route's `beforeLoad()` not run when parent route throws a redirect?

Given these routes: * /accounts/$accountId/route.tsx * /accounts/$accountId/settings/billing.tsx We use route param placeholders so we can link to account routes from emails, e.g. to /accounts/_/settings/billing and we replace the _ value with the currently logged in $accountId....
rival-black
rival-black9/12/2024

Recommended Path Segment

Lets say I have the following routes - hello - hello/foo - hello/bar - hello/fee ...
adverse-sapphire
adverse-sapphire9/11/2024

Are there workarounds for using validateSearch with lazy file routes?

Looking to reap the benefits of validateSearch alongside lazy-loaded routes (createLazyFileRoute). I get why it's not possible, but, wondering if there's a preferred work-around or some magic cooking to make validation possible once a lazy route file has loaded. 🙏 Thanks all!
No description
curly-silver
curly-silver9/11/2024

How do I pass queryClient throughout my app with tanstack router/query

I want to pass the queryClient object to all pages in app, but I am unable to access it from the Dashboard. When I include the link to my Dashboard in the NavgationHeader, I am able to access the queryClient object, but I don't want to have the Dashboard in that file., main.tsx: ``` const routeTree = rootRoute.addChildren([indexRoute, signupRoute, signinRoute, dashboardRoute]) ...
rare-sapphire
rare-sapphire9/11/2024

Following TanStack Start tutorial / Playing with example and app won't start

Getting this error: (!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling. when playing around with this tutorial https://tanstack.com/router/latest/docs/framework/react/start/getting-started. Downloaded the project from Stackblitz as well and it still won't open up. What could be the issue?
fair-rose
fair-rose9/10/2024

Deeply passing down context

I have a React hook which provides a wrapper around fetch which automatically retrieves an access token via another hook. Within previous custom useQuery() hooks, I could just use that hook, since everything was React hooks. Now within TanStack Router, I don't have that option anymore. I know that I can pass the hook result through context and then pass the wrapped fetch function through to *QueryOptions() methods, but that seems extremely repetitive. Is there a better make the result of my original hook available to all my fetch*() functions without having to pass it down in every single place?...
eager-peach
eager-peach9/10/2024

useMatchRoute and useLocation are not in sync

after i navigate my useLocation and useMatchRoute hooks are out of sync with eachother. ```function MyComponent() { const location = useLocation() const matchRoute = useMatchRoute() ...
automatic-azure
automatic-azure9/9/2024

Dynamic Nav?

Can someone point me to a simple example of creating a dynamic nav based on file-based routes? I am feeling pretty dumb that I can't find an example in the docs.