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

wise-white
wise-white12/6/2023

File-based routing bug or misconfig?

Tldr: I'm using file-based routing and the CLI sets all routes as children of rootRoute, which is unexpected Note the paths and getParentRoute calls in the generated file here: ```typescript...
like-gold
like-gold12/6/2023

Cannot read properties of undefined( reading 'routeId')

Sometimes, I'm having this runtime error while routing. https://github.com/TanStack/router/issues/704 3 months ago I created this Github issue. I was using "@tanstack/react-router": "^0.0.1-beta.173" and it was fixed by @Tanner Linsley . However, it recurred. I switched to "@tanstack/react-router": "^0.0.1-beta.225" from "@tanstack/react-router": "^0.0.1-beta.194" and it occurred again. Unfortunately, this is a showstopper....
No description
mute-gold
mute-gold12/6/2023

Throwing a not found route with Navigate?

When a user hits a dynamic path that's incorrect (i.e. not their org/team id), how might i throw them to the 404/not found? I imagine it's actually better to redirect them to a dynamic path with their correct id. but this navigate doesn't seem to fire off when the teamId ==! orgId either to a 404 or a dynamic path with their correct id in this example i edited the teamId of the URL...
No description
fair-rose
fair-rose12/1/2023

CLIKENT SIDE ERROR USING TANSTACK

hi, im getting this error on my web page , is there anythng im doing wrong??
No description
ambitious-aqua
ambitious-aqua11/29/2023

tsr generate not working

Hi everyone! I am having an issue with router-cli. When I run tsr generate I am getting an error that says The "paths[0]" argument must be of type string. Received undefined I have a trs.config.json file, i have routeTree.gen.ts file, i have a routes folder where I have three files -> __root.tsx, _layout.tsx, index.tsx...
harsh-harlequin
harsh-harlequin11/28/2023

Breadcrumbs

I'm struggling to find the right solution to create breadcrumbs in the following route structure: - root: - /segment - /segment/$id...
foreign-sapphire
foreign-sapphire11/28/2023

On subroute path/url change, whole tree reloads?

Is this a correct behaviour? while I am on the route /product/<product_category/<product_Id> and just the product id changes, all of the load property on the new Route() setup is retriggered. That means when the product_id changes, /product/<product_category> retriggers its actions in the load function. The same for /product, the load function is triggered as well here, even tho the <product_id> has changed. ...
fair-rose
fair-rose11/27/2023

Global named route object

Hey, is there a way to get the name of routes in a similar fashion like Redwood https://redwoodjs.com/docs/router#link-and-named-route-functions ```ts import { routes } from '@redwoodjs/router' ...
quickest-silver
quickest-silver11/22/2023

Detach component from route declaration, typescript vs vite

I've been trying Tanstack router for a couple of weeks now, and I'm not sure how to approach the route definitions. I started having the component inside the route definition because that's what I saw in the react-query example. But I realised that the page was doing a full reload every time I saved a file, after some research I found this issue https://github.com/TanStack/router/issues/510#issuecomment-1464898679. Basically the vite react plugin will hot reaload only when exporting react components (more info in https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md#consistent-components-exports). So I decided to refactor the app and keep the route definition in one file and the component in a different one, but now I am facing a different problem, before, the component function in the route definition gave me the useRouteContext, and different hooks as props, and now I don't have that....
conscious-sapphire
conscious-sapphire11/19/2023

Question on catch-all routing

Hey all, just trying to understand why this example does not work (I am trying to catch-all under a specific path /auth/* using redirectAuthRoute2): ``` export const authRoute = new Route({ getParentRoute: () => rootRoute, path: "auth",...
optimistic-gold
optimistic-gold11/17/2023

useSearch does not work when you pass a string to form, instead of `route.id`

https://github.com/TanStack/router/issues/767 useSearch: Typescript Error "Property 'email' does not exist on type '{} | {} | {} | { email: string; }'" Is there a way to go around this issue? The problem with using route.id, is that we run into circular dependency, and VITE hot reloading stops working ...
like-gold
like-gold11/15/2023

index routes

/ tests : TestPage applications : ApplicationPage login: XPage (i added this for educational purposes) /login : LoginPage...
ratty-blush
ratty-blush11/13/2023

Structure for react-refresh

What's a good way to structure files to make react-refresh work? I export Route objects from one file per route and inline my components in the Route options to get the typescript props automatically, but that causes react-refresh to fail. Exporting both the Route and the component from the same file as separate consts causes eslint react-refresh warnings.
genetic-orange
genetic-orange11/10/2023

Hi, I'm trying to use infiniteQuery in version 5, but the typing is not returning the item pages

``` function useListUsersInfinite( options?: IListUserWithPagination & { page?: number }, params?: UseInfiniteQueryOptions<IPaginate<User>> ) {...
No description
flat-fuchsia
flat-fuchsia11/9/2023

router-cli Usage

I want to use router-cli in my project, but when I run the generate command, I got this error: ``` /usr/local/bin/tsr: line 1: /Applications: is a directory /usr/local/bin/tsr: line 2: README.md: command not found /usr/local/bin/tsr: line 3: README.md: command not found...
dependent-tan
dependent-tan11/8/2023

Is it possible to navigate to update searchParams without remounting the component?

Hey, I have following query-question https://discord.com/channels/719702312431386674/1171836679204655194 The issue is that keepPreviousDate does not work when filtering with searchParams. Is there a way to achieve this goal or am I barking up the wrong tree. Thanks...
generous-apricot
generous-apricot11/8/2023

Outlet does not render when using @testing-library/react.

Hey there, I'm moving to using @tanstack/react-location with an existing project that was previously using react-router-dom. Version in package.json is ^3.4.4 - this is because I am implementing a Module Federation solution that already exists in another project, and wanted to keep the versions in sync for the time being. All is working well, and I hasn't had any issues with dev. However, my integration tests appear to be failing due to the <Outlet /> component not rendering the element associated with the route I'm feeding it....
dependent-tan
dependent-tan11/8/2023

router.navigate has been removed

Hey 👋🏽 Will router.navigate come back, or is this option to navigate no longer available? will something like this be possible? ...
dependent-tan
dependent-tan11/8/2023

Update search params without rerender

Hey 👋 I want to know, if it is possible to update search params of the current route, without a rerender/remount. Use-case I want, additional to the filter, to store the selected-row-state in the search-params. Now a row-selection should not cause a remount. It should just add the info to the search-params. When the url is reloaded, the information should be used to select the corresponding row initially. Is that possible? Or how you would solve such an use-case? ...
dependent-tan
dependent-tan11/7/2023

Is it advisable to make heavy use of SearchParams?

hey 👋🏽
It is tempting to handle a complete filter state in the address bar. Then the history works and it's a great user experience, but is it really advisable to handle a large filter state with the help of the SearchParams. I mean a pagination-filter with about 10 filter values, which also consist of complex types. Isn't it possible that you reach limits? Thanks...