首页 > React router 跳转有几种方法

React router 跳转有几种方法

React router 跳转有几种方法
我就知道<Link to="/"> ...</Link>, 如果点击button按钮 应给怎么写,还有就是在函数方法里面怎么跳转?


this.context.router.push('/home');

使用 this.context.router 声明 该类contextTypes

className.contextTypes = {
    router: React.PropTypes.isRequired
} 
【热门文章】
【热门文章】