Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to just get the information if the back or forward button isclicked ? #8

Open
batuhanbuena opened this issue Nov 17, 2024 · 1 comment

Comments

@batuhanbuena
Copy link

No description provided.

@ypresto
Copy link
Collaborator

ypresto commented Nov 19, 2024

It might looks a little hacky but you can get it by confirm function which always returns true:

useNavigationGuard({
  confirm: ({ type }) => {
    if (type === 'popstate') onBackForward()
    return true
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants