I am trying to get my search bar to work correctly.
When doing a search, the router sends me to / list / (whatever I was looking for)
The search bar changes its route programmatically like this:
var pathname = '/list/';
var query = {
q: this.state.searchBar
};
hashHistory.push({pathname, query});
/ list /: q has a componentDidMount function that sends a GET request to the database, but if I do a new search and allready is in '/ list /: q', the url is updated, but the component does not restart.
My problem: How can I make my component reboot when creating a new search, although it is already on the search route / 'list /: q'?
Corresponding Code:
Pastebin Link