react redirect with query params code example
Example: react router redirect with query params
import { withRouter } from 'react-router-dom';
class SearchComponent {
// Component Code goes here
onSubmit(){
let queryString = "q=" + this.state.q;
this.props.history.push(`/search/hotels?${queryString}`);
}
}
export default withRouter(SearchComponent)