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
As per the docs: The blocking only affects what history can register and properly intercept - and only on the transition between locations. With your particular situation, the initial location is already registered (in createHashHistory) when you activate the block. So history can't know to show the confirmation dialog, because there simply isn't any transition from "no location" to "initial page".
So, you have to prompt the user yourself on initial load.
@StringEpsilon Actually, it is just a demo to show case when a page initial load that can not affect history.block. I was not only to prompt the user on initial load, I wanted to provided navigation guards with history.block and getUserConfirmation, I have finished two guard hooks beforeEach and beforeEnter, but they were not called on on initial load, it because of history.block.
Version
history: 4.10.1
Test Case
https://codesandbox.io/s/billowing-cache-oijj8
Steps to reproduce
Expected Behavior
expect confirmation dialog show up when a page was loaded first
Actual Behavior
The text was updated successfully, but these errors were encountered: