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

genetic-orange
genetic-orange9/6/2024

HMR: Invariant failed: trying to access property 'id' on a route which is not initialized yet.

I'm experiencing this error when changing files. Refreshing the page makes the error disappear: Invariant failed: trying to access property 'id' on a route which is not initialized yet. Route properties are only available after 'createRouter' completed. The stack trace points to a Route.useRouteContext call....
harsh-harlequin
harsh-harlequin9/5/2024

Error using ensureQueryData

ive been developing my app for long time using tanstack router and query, and im having problems in the part of handling authentication, my app works perfectly but when, the access token expired then the problem appears, i made my backend with rust and i made an endpoint to check the status of the cookies to see if the tokens are valid, so in the frontend im trying to handle this in the AuthContext, and then i checked the doc of tanstack to follow how do i face this problem but nothing, if anyon...
No description
correct-apricot
correct-apricot9/5/2024

Sharing data between routes using tanstack-router file based routing with generated routes

I'm trying to figure out how to share a react context between two nested routes /users /users/$id ...
conscious-sapphire
conscious-sapphire9/5/2024

Parse search params "manually"?

I have implemented a Data Table component that can save filters. Filters are saved on the server as a string that is the page's search params. Example: channelId=%5B%22Azure_Test%22%2C%22BMQ_Test%22%5D&sortBy=channelId&sortOrder=asc. When I load this filter, I want to do the same operation that TanStack Router does to create the equivalent JSON object (channelId as a string array, sortBy as string, etc). How do I do that?
genetic-orange
genetic-orange9/5/2024

RouterContext

We have recently brought the router into our project at work. My co-worker is not happy with my use of navigate calls when form fields are updated. (A search interface). He feels that we should be able to create a RouteContext and when form fields are updated update the context and it should update the url. I don’t think it works that way. Anybody have any experience or guidance they can offer?
fascinating-indigo
fascinating-indigo9/5/2024

AuthProvider Context is not getting sync with RouterProvider

I have a login page and when login is successful I am setting the userinfo and session storage and updating the AuthProvider Context but when I see the devtools the info is not in sync.
No description
fair-rose
fair-rose9/4/2024

@ in param

If I do something like this
<Link to="/$profile" params={{ profile: `@user` }>Name</Link>
<Link to="/$profile" params={{ profile: `@user` }>Name</Link>
the element is being formed as...
passive-yellow
passive-yellow9/4/2024

Layout Rendering Twice

Any idea why my root layout for /dashboard is still rendering when i am on camera page for example:
No description
passive-yellow
passive-yellow9/4/2024

Issue with $id param in page

Property 'cameraId' does not exist on type 'Record<never, string>'. ```ts export const Route = createFileRoute( "/_authenticated/(camera-layout)/dashboard/camera/$cameraId/"...
No description
deep-jade
deep-jade9/3/2024

tanstack router + tanstack start

Hi guys, I'm having lot of meetings with the CTO of my company to discuss the new tech stack for all our projects. Ours "go to" are: - react query - tanstack-table We want 100% CSR(client side rendering for most of our projects/routes) and in the future migrate to SSR "some" routes/pages according if we need to improve SEO, loading speed etc....
sunny-green
sunny-green9/3/2024

Persist component between non-grouped routes?

Hey, My understanding is that you can persist components between routes by putting them into a group and then putting the components you want them to share in the layout of the group. But what if you have two routes which are already in different groups? Here's an example from a mobile site that we're working on:...
foreign-sapphire
foreign-sapphire9/3/2024

Type safety for search params when the `from` option is not provided

I have the following route with validateSearch ```ts export const Route = createFileRoute('/dashboard')({ component: Dashboard,...
fair-rose
fair-rose9/3/2024

Is it possible to filter the route param with Tanstack Router?

I have several types of interfaces: - for /@{user} I need to show user profile page - for other (/, /game, /trends, /movie, ...) paths as /{section} I need to show section info page ...
absent-sapphire
absent-sapphire9/3/2024

How is this auth implementation (WorkOS/Syncing to DB)

I have a question for my auth use case if anyone is willing to offer a 2nd opinion In my app an Organization has both 1+ users and Org/Users are assigned to 1+ workspaces. Using WorkOS here and trying to make sure my backend is synced with WorkOS Not sure if there's a better way of doing this....
flat-fuchsia
flat-fuchsia9/3/2024

pass a “state” when using “navigate()”

Hey, Thanks for all the help with the previous question. Now to the next one: After sign up I’m redirecting user to “sign in” page using “navigate({to: “/sign-in”})”. I want to display some kind of toaster for users that just signed up and are on sign in page to inform them to check the email. ...
foreign-sapphire
foreign-sapphire9/3/2024

How to get the available routes as a type

Is there a way to get the available paths as in /, /about, /profile etc. as a type?
foreign-sapphire
foreign-sapphire9/3/2024

Link component expects `search` prop when validateSearch is used in a route

```ts export const Route = createFileRoute('/dashboard')({ component: Dashboard, validateSearch: (search: Record<string, unknown>): PaginationState => ({ pageIndex: Number(search.pageIndex) || 0,...
fascinating-indigo
fascinating-indigo9/3/2024

Question about route conflicts

Hello. With file-based routing, how can I achieve: /items - $itemId.tsx...
passive-yellow
passive-yellow9/3/2024

tanstack router, tanstack query with zustand?

is tanstack router and tanstack query recommended to be used with zustand?**
modern-teal
modern-teal9/2/2024

Routes not loading if navigated directly to it

Hi! I'm trying to figure out why after building I can't open links directly to nested routes, as it cant find any of the assets (JS and CSS bundles) I believe this is a vite thing but i followed the docs and doesn't mention anything about the base route, any ideas on how to fix this? For example: https://supersecretDomain.com/cabina works as it should, but https://supersecretDomain.com/cabina/1 where routes is defined as /_layout/cabina/$serviceOrderId doesn't load...