#Autocomplete and url typing not working

10 messages · Page 1 of 1 (latest)

dreamy pecan
#

Hey guys, I installed Tanstack router and made several routes.

It works well, except that when I use <Link> or useNavigate(), I don't have url autocomplete and type validation.
I'm using react-vite, and the plugin is enabled in first in my vite.config.ts file.

Any idea what's going on ?

fleet arrow
#

did you register the router types via the module declaration?

dreamy pecan
#

Hmm

#

I don't think so

#

Like this:

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

yes that's required

#

as shown in the docs

dreamy pecan
#

Nice it works 😄 i didn't checked this page before !

#

And is there a Type i can use for url ?
Like I want to pass an url to a page to a component prop, what Type should I give to my prop ?

fleet arrow