How to pass params when user clicks BackButton in browser in react

Viewed 94

I'm Using react ,

  1. Intially the user will be in '/page1'
  2. He selects a course from the dropdown and he clicks continue button
  3. he will be redirected to '/page2' , selected course_id is present in page 2 component props
  4. Now what i am trying to do is , when the user clicks back button in the browser he is redirected to '/page1' , but instead i need to '/page1?course=course_id" , so that the course which he has selected initially is now pre-selected..
0 Answers
Related