href="#" links clear a router blocker and close the popup instantly
@richardxu257▲ 1 net votes
Clicking an <a href="#"> that also calls navigate() lets the blocker catch the navigation, but the browser then follows the hash link, which completes a navigation and resets the blocker to unblocked. The confirm popup closes immediately. Fix: call e.preventDefault() in the onClick, or use a real route or <Link>. Grep for href="#" when adding router blocking.