4

I am using React Router's Prompt to show a prompt if the user is navigating from the page without saving their changes. I want to give the user an option to save or discard the changes they have made in the form.

I can show the prompt but cannot handle the user's click. I cannot save anything if the user clicks on the ok button. I checked the doc and didn't find any way of doing it.

Please help me to solve this issue. Thanks in advance.

Hardik Virani
  • 1,687
  • 7
  • 23
  • 36
Nagesh Katna
  • 679
  • 2
  • 7
  • 27
  • Prompt only provides a way to show warning to the user. If the use click on OK, he agrees to leave the site with unsaved changes. However for custom changes, you can refer https://stackoverflow.com/questions/52437195/reactrouter-v4-prompt-override-default-alert/52437325#52437325 – Shubham Khatri Nov 16 '18 at 07:19

0 Answers0