#Tanstack Router: Get the current location/path

4 messages · Page 1 of 1 (latest)

chilly girder
#

Is there any way to retrieve the current location of the router?
to give an example of what I'm talking about, in react-router it was possible to use the useLocation hook to get the pathname of the router, is there the same thing or an alternative with tanstack?

maiden zenith
#

how about:

  const location = useRouterState({ select: (s) => s.location })
chilly girder
maiden zenith
#

we are in the process of updating the docs, stay tuned