I have to show an alert on the browser back event on React js. I have tried using the `addEventListener` but I'm not sure where to place the code in the React page. Should I place in any life-cycle hooks or in the render? I'm not sure. Please help me out.