📌  相关文章
📜  使用查询参数反应路由器重定向 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:17.180000             🧑  作者: Mango

代码示例1
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)