You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use nav guards in combination with nprogress to show a loading UI when navigating between pages; if a nav guard is active I don't want to show that progress indicator. Would be great if there were some way to know if any nav guards were active across the app in a central place. I think it is possible as of now by wrapping the useNavigationGuard hook manually, but would be great if there was a utility to make this simpler.
Hello, if you are using pnpm or yarn, you can use 'patch' feature.
this library use a ref of guard map for check & control guards.
so you can create useNavigationGuardStatus hook like this and patch to detect nav guards are active.
Activity
[-]a way to detect if any nav guard are active?[/-][+]a way to detect if any nav guards are active?[/+]tilto0822 commentedon Apr 30, 2025
Hello, if you are using pnpm or yarn, you can use 'patch' feature.
this library use a ref of guard map for check & control guards.
so you can create
useNavigationGuardStatushook like this and patch to detect nav guards are active.ypresto commentedon May 28, 2025
useNavigationGuardState()feature is PR welcomed..!