title: How do you normally redirects a user after they log in to an account in React router dom?
body: <p>So let's just say I forgot to log in, and I tried accessing a login protected page like this</p>
  <pre><code>'http://localhost:3000/main/login-protected-page'
  </code></pre>
  <p>so I got redirected to the login page with URL like this</p>
  <pre><code>'http://localhost:3000/auth/login'
  </code></pre>
  <p>so I've used Django in the past and they handle it like this</p>
  <pre><code>'http://localhost:3000/auth/login/next=/your/next/destination'
  
  //or in this case
  
  'http://localhost:3000/auth/login/next=/main/login-protected-page'
  </code></pre>
  <p>the idea being getting that <code>next</code> variable from the link and use it to redirect the page
  how do you do this in <code>react-router-dom</code>?</p>
  <p>and also feel free to leave a keyword so I can learn more or maybe suggest some better ways of doing this I would greatly appreciate it thank you</p>