title: Change route on Modal Open - React
body: <p>Is there a way to change the route on opening a modal in React using react-router-dom.</p>
  
  <p>I made the modal using react-modal and its meant to display an image up close, so I want to update the route with the image ID, so that I can send a get request to my server using the ID in req.params.id and fetch the image and other related data.</p>
  
  <p>Also on modal close, I would like to be redirected back to the gallery route.</p>
  
  <p>Any help would be much appreciated, have a lovely weekend! </p>