2016-11-23 5 views

答えて

1

実際にはできません。 しかし、リダイレクト時に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

+0

おかげですべてのあなたの歴史を見つける必要があり、私は実際には常に 'のパスの試合でレンダリングするルートの' componentWillUpdate'でこれをしなければなりませんでした/ '、私は' location.key'を比較します – Noitidart

関連する問題