1

I am trying to implement a hook that prevents users from 'unintended' route change such as back button or reload. I am using react-router v3, so <Prompt /> in react router v4 does not work for me.

I have looked into setRouteLeaveHook but it does not handle accidental reload action. Any suggestion would be appreciated :)

chan wook
  • 13
  • 2

1 Answers1

0

I had a similar issue, and I I had my own solution manipulating both setRouteLeaveHook and onbeforeunload.

Here is a link to my answer

Sang Yun Park
  • 459
  • 7
  • 14