title: Detecting user leaving page with react-router-dom v6.0.2
body: <p>I am trying to show Dialog Box for unsaved changes before navigating to other route or page in ReactJS web app. I tried different solution from Stackoverflow but didn't succeeded. Most of solution related to older version. I need for version <strong>6.0.2</strong> (react-router-dom). Anyone who can help me out in this really appreciated.</p>