I\'m trying to use this piece of code to send a websocket message to the back-end when a page is closed.
useEffect(()=>