T
TanStack7mo ago
fascinating-indigo

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
quickest-silver
quickest-silver7mo ago
const status = useRouterState({select: (s) => s.status}
)
const status = useRouterState({select: (s) => s.status}
)
fascinating-indigo
fascinating-indigoOP7mo ago
Will this be triggered by preloading too or just between navigation?
quickest-silver
quickest-silver7mo ago
should just be between navigations
fascinating-indigo
fascinating-indigoOP7mo ago
Thanks Manuel!

Did you find this page helpful?