I can\'t seem to find how to update query params with react-router without using .
hashHistory.push(url)
doesn\'t seem to register que
Example using react-router v4, redux-thunk and react-router-redux(5.0.0-alpha.6) package.
When user uses search feature, I want him to be able to send url link for same query to a colleague.
import { push } from 'react-router-redux';
import qs from 'query-string';
export const search = () => (dispatch) => {
const query = { firstName: 'John', lastName: 'Doe' };
//API call to retrieve records
//...
const searchString = qs.stringify(query);
dispatch(push({
search: searchString
}))
}
It can also be written this way
this.props.history.push(`${window.location.pathname}&page=${pageNumber}`)