是否有可能从ReactRouter.browserHistory获取以前的路径数和路径值? 其实你做不到. 但您可以尝试在browserHistory状态下存储列表,并在重定向时在其中推送新路径. let history = this.props.location.s
但您可以尝试在browserHistory状态下存储列表,并在重定向时在其中推送新路径.
let history = this.props.location.state.history; history.push(this.props.location.pathname) browserHistory.push({ pathname: '/yourpath', state: { history: history } })
通过这种方式,您应该在this.props.location.state.history中找到所有历史记录