My react application has the react-router v4 with the following search filter function:
filterList = (e) => {
let { value } = e.target;
this.setState({ value }, () => {
var searchValue = this.state.value.toLowerCase();
var updatedList = this.state.holder;
updatedList = updatedList.filter((item) => {
return Object.keys(item).some(key => item[key].toString().toLowerCase().search(searchValue) !== -1);
});
this.setState({ books: updatedList });
});
}
When I edit, it will route to edit page. When edit finish it route back, how can I route back with remain search result?