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

[Feature]: useOnChange hook #9766

Closed
luist1228 opened this issue Dec 20, 2022 · 1 comment
Closed

[Feature]: useOnChange hook #9766

luist1228 opened this issue Dec 20, 2022 · 1 comment
Labels

Comments

@luist1228
Copy link

luist1228 commented Dec 20, 2022

What is the new or updated feature that you are suggesting?

A hook that allows you to prevent the navigation by passing a function that returns either an object or a boolean so that you can do a check or an operation before navigation

Why should this feature be included?

The useLocation and useEffect isn't enough for some use cases like hitting a home button in nav and if some changes need to be saved give the user a prompt or a modal, or doing an action in some routes before changing route

@timdorr
Copy link
Member

timdorr commented Dec 21, 2022

#8139 (comment)

@timdorr timdorr closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants