1
私はReact Reduxアプリを持っていて、私のレデューサーの1人でreact-router
の位置変更を待ち受けようとしています。私はhashHistory
を使用していますが、browserHistory
ではありません。私の再来のデベロッパーツールでは、私は場所が変更されたとき、それがアクションを発射されて見ることができます:私は「LOCATION_CHANGE」の聴くとredux reducerの反応ルータ位置の変更をどのように聞きますか?
しかし、私の減速で、それが何かをキャッチしません。
import * as types from '../constants/actionTypes';
import objectAssign from 'object-assign';
import initialState from './initialState';
export default function listingsReducer(state = initialState.listings, action) {
switch (action.type) {
case 'LOCATION_CHANGE': {
console.log(action); //currently doesn't get into this case block
return state;
}
default:
return state;
}
}
私のレデューサーでこの行動を処理するには何が必要ですか?