I want to add a confirm dialog when users switch to other routes without saving changes. I found some Stack Overflow posts of setRouteLeaveHook() function. But I cannot find it in official document. Is it still supported? Where could I find an official document or tutorial? Thanks!
Nope. Use a Prompt instead: https://reacttraining.com/react-router/web/example/preventing-transitions
but it warns 'A history supports only one prompt at a time'? why and how?
maybe the reason is i use the 'rc-queue-anim', but i am not sure and even do not know how does it cause the problem
@timdorr
https://github.com/ReactTraining/react-router/blob/v3/docs/guides/ConfirmingNavigation.md
Not a detailed documentation but still an official documentation with brief example.