title: Detect when browser back button is pressed - ReactJS
body: <p>How can I detect when back button on browser (Chrome, FireFox, Safari etc.) is clicked through JavaScript on my React website and take actions accordingly?</p>
  <p>Also, when back button on mobile is pressed, is the event same or similar to when back button in browser is clicked?</p>
  <p>Looking forward for an answer. Thanks in advance.</p>