How to use window.onbeforeunload in React for showing popup for reload if the user clicks on reload.
I tried doing this it is not working