title: Can you lock an user from doing refresh and force him to use buttons instead?
body: <p>I have a code in where the user send some data to another route with useLocation() and it works perfectly fine, however when I refresh it tells me:</p>
  <p>TypeError: Cannot read properties of undefined (reading '0')</p>
  <p><a href="https://i.stack.imgur.com/QVTFS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QVTFS.png" alt="enter image description here" /></a></p>
  <p>I'm not using localStorage (because I don't understand it very well yet) so is there a way to lock   the refresh so the user can't refresh? I have seen something similar in other pages it doesn't even let me go back unless I use a specific button.</p>
  <p>I'm open to suggestions, tips and help is welcome.</p>