#Want to show Prompt or confirmation box

1 messages · Page 1 of 1 (latest)

lunar forum
#

What is the alternate of Prompt in react-router V6 ? usePrompt right ? If use usePrompt I am getting useBlock must be used within a data router.
I want to show a confirmation box if user click back button of browser or reload the browser screen.
As, react-router V6 don't update the history.pushState therefore popState is not executing...

coarse depot
#

You must be using one of the router types that don't use browser's DOM History API (memory router? hash router?). The correct one to use is the browser router, since browser router uses DOM History API.

lunar forum
#

I am using BrowserRouter instead of createBrowserRouter hook. Do BrowserRouter not use browser's DOM History API ?

coarse depot
lunar forum
#

Is there any option other than changing ? I am agree it is good to switch to createBrowserRouter.
BTW thank you for your help