chefcurry7 chefcurry7 - 13 days ago 6
React JSX Question

Cancel componentUnmount when navigating away

I would like to give a user notification if they have started an application and are navigating away without saving. Once they click on another tab, the componentWillUnmount function will fire, is there anyway I can cancel it in case a user decides to stay on the same form?

Answer

Since you are using React Router, see Confirming Navigation.

Comments