0

I want to know when a user closes out of a session. This includes if multiple tabs are open. Only to record 1 session close if that happens.

If this possible? How using react-hooks?

If tried the below in App.js. Is there a more effective way to solve this solution?

useEffect(() => {
  return () => {
    console.log(props.current);
  };
}, [props.current]);
journalsup
  • 138
  • 1
  • 10
  • Is this what you need? https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing – Lin Du May 23 '23 at 06:19

0 Answers0