#Bunch of Route functions are returning an any type

8 messages · Page 1 of 1 (latest)

sleek coyote
#

I know the title is confusing sorry.
I have a route on /channels/@me and then another route on /channels/@me/$channelId which is the same just now with a param.
But when I navigate to /channels/@me/$channelId and give it a param, I'm still navigates back to /channels/@me. It seems to have a higher priority somehow...

tame elbow
sleek coyote
#

Bunch of Route functions are returning an any type

tame elbow
#

do you have the type augmentation set up? (https://tanstack.com/router/latest/docs/guide/type-safety#exported-hooks-components-and-utilities)

declare module '@tanstack/react-router' {
  interface Register {
    router: typeof router
  }
}

also stackblitz is sometimes weird with TS when using generated types. Do you actually have the issue locally on your machine?

TanStack Router is built to be as type-safe as possible within the limits of the TypeScript compiler and runtime. This means that it's not only written in TypeScript, but that it also fully infers the...

sleek coyote