Skip to content

a way to detect if any nav guards are active? #33

Open

Description

@osdiab

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.

Activity

  1. changed the title [-]a way to detect if any nav guard are active?[/-] [+]a way to detect if any nav guards are active?[/+] on Apr 23, 2025
  2. tilto0822 commented on Apr 30, 2025

    @tilto0822

    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.

  3. ypresto commented on May 28, 2025

    @ypresto
    Member

    useNavigationGuardState() feature is PR welcomed..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions