MENU
useBlocker
The useBlocker hook lets you intercept navigation within your app – for example, to warn a visitor about unsaved form changes before they leave the page. It replaces the <Prompt> component from older versions of React Router, and requires a data router (see the Routers section).