How to get previouse redux state on Back button

388 views Asked by At

I have search page where there is a search bar and some search filters. User can filter data using filters. on every filter change I am calling an api which brings updated data I am also updating route path accordingly. But when user press back button I want to redirect user to previouse page with last results popluated. I don't want to hit the api call again to fetch the data. is there a way that redux mentains it's history which can be auto populated when user press back button.

1

There are 1 answers

1
Manoj Kumar On

You can use componentWillUnmount and reset your data on that function.