连接的反应路由器-this.props.history.push不起作用

时间:2018-10-10 16:44:55

标签: connected-react-router

我在项目中将react-router-redux替换为conncted-react-router。我有一个OnChange

onChange = (event) => {
   this.props.history.push(`?page=${event.currentPage}`)
  }

以及稍后在render()中,我通过“搜索”参数对其进行访问

render () {
    const {location} = this.props
    const currentPage = parseInt(new 
    URLSearchParams(location.search).get('page'), 10) || 1
...
}

但是当我使用“ connected-react-router”时,“搜索”参数为空 为什么会这样?

我的“取消”功能

onCancelForm () {
    this.props.history.goBack()
  }

这些也不起作用。

0 个答案:

没有答案
相关问题