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
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!
The text was updated successfully, but these errors were encountered:
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 exposesaction
. It would be useful to expose this towhen
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!
The text was updated successfully, but these errors were encountered: