私は一時的にIが反応-ルータV4で起こると仮定この問題を解決するようなので、(Iも反応ルータ-DOM有する)。
コンポーネントから履歴オブジェクトを渡す(セレクタ)また、私はcreateHistoryが私のために働かなかったことを指摘しなければならない
export function register(user, history) {
// this history is the argument from the register call in the component
return function (dispatch) {
dispatch(initRequest()); // show spinner or something
return Auth.register(user)
.then(()=> {
dispatch(registerSuccess());
history.push('/new-route');
}).catch((err)=> dispatch(setErrorMessage()))
}
}
引数として(「/新ルート」)history.pushを呼び出すアクションの作成者の定義でアクションの作成者に、その後は、私がしなければなりませんでした:
import createBrowserHistory from 'history/createBrowserHistory'
const history = createBrowserHistory();