T
TanStack4mo ago
spiritual-aqua

Access Current Navigation State

I was wondering if there's a way to access the navigating state. On mobile because of route loaders navigation isn't instant and I would like a way to indicate that, like an indeterminate page loading progress bar that is displayed between the user clicking a link and the next page loading in. Is there some way to access the loading state of the location a user is navigating to?
4 Replies
foreign-sapphire
foreign-sapphire4mo ago
const status = useRouterState({select: (s) => s.status}
)
const status = useRouterState({select: (s) => s.status}
)
spiritual-aqua
spiritual-aquaOP4mo ago
Will this be triggered by preloading too or just between navigation?
foreign-sapphire
foreign-sapphire4mo ago
should just be between navigations
spiritual-aqua
spiritual-aquaOP4mo ago
Thanks Manuel!

Did you find this page helpful?