Answers for "react router redirect with query params"

0

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)
Posted by: Guest on February-03-2021

Code answers related to "react router redirect with query params"

Code answers related to "Javascript"

Browse Popular Code Answers by Language