反应路由器历史记录推送状态对象未清除

时间:2018-12-13 13:26:53

标签: javascript reactjs redux react-redux

我是react router and react的新手。

在这里,我有一条正在使用的路线,

history.push({
  pathname: '/quiz-questions',
  state: {
    isReload: false
  }
})

现在,在该组件中用于渲染的

constructor(props) {   
  super(props)
  console.log(props.location.state.isReload)
}

使用此,我尝试打印。它正在打印。

现在,当我reload这段时间this state variable should not contain that value时,在这里仍在获取该值。

那么,为什么会这样?

0 个答案:

没有答案
相关问题