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

Request: expose action to when #78

Closed
timhwang21 opened this issue Sep 17, 2021 · 2 comments
Closed

Request: expose action to when #78

timhwang21 opened this issue Sep 17, 2021 · 2 comments

Comments

@timhwang21
Copy link
Contributor

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

The when callback takes two arguments: previous location and next location. block from React Router also exposes action. It would be useful to expose this to when as a third argument. For example, one may want to not trigger the confirmation on 'REPLACE' events.

In my case, we sometimes use 'REPLACE' to open subpages that still exist within the context of the "main" page, and we don't want the confirmation to pop up. This isn't a blocker for us as we can compare the two locations for root route or something, but using the action would be far easier.

If this is reasonable, I can file a PR!

@ZacharyRSmith
Copy link
Owner

@timhwang21 makes sense to me. Please PR. Thanks!

@ZacharyRSmith
Copy link
Owner

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

No branches or pull requests

2 participants