📜  反应路由器从函数更改路由 - Javascript代码示例

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

代码示例1
import {withRouter} from 'react-router-dom';
this.props.history.push('route');
export default withRouter(your component name)
the react component should be wrapped with withRouter hoc 
so that history will work