2016-03-23 22 views
0

私はreact-redux-routerを使用します。リダイレクトを試みます。しかし、私は今これを正しく行う方法はありません。私が知っている解決策は "@@ router/LOCATION_CHANGE"イベントをディスパッチすることだけですが、それは正しくないようです。リダイレクトを行うより良い方法はありますか?route reduxにリダイレクト

+0

'routerMiddleware'と使用を適用します:' store.dispatch(プッシュ( '/ foo')) '。 Via https://github.com/reactjs/react-router-redux#what-if-i-want-to-issue-navigation-events-via-redux-actions – lux

答えて

1

経路を訪れたときのリダイレクトは、リダイレクトコンポーネントで行うことができます。 https://github.com/reactjs/react-router/blob/master/docs/API.md#redirectを確認してください。反応 - ルータ - Reduxのからアプリ自体にリダイレクトするために

、(プッシュを確認してください)(あなたはこのライブラリを使用しているように見える):https://github.com/reactjs/react-router-redux#pushlocation-replacelocation-gonumber-goback-goforward

+0

ありがとうございます! –