Я пытаюсь настроить хранилище редуктов с помощью промежуточного программного обеспечения саги и асинхронных действий, а также обработчиков-ретрансляторов и селекторов.redux saga не может прочитать свойство getState of undefined
Для некоторых sagamiddleware нельзя прочитать свойство getState неопределенного. Я не знаю почему.
моя структура высшего уровня НАПРАВЛ:
./src/app.js
./src/sagas/index.js and imported sagas into this file
./src/Containers/App/actions.js constants.js appReducer.js selectors.js
./src/Containers/App/toplevelcomponenthere
app.js
import sagas from './sagas';
import createReducer from './reducers.js';
const sagaMiddleware = createSagaMiddleware();
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware,
sagaMiddleware(...sagas))(createStore);
const store = createStoreWithMiddleware(createReducer);
const reduxRouterMiddleware = syncHistoryWithStore(browserHistory)
//add selectors and history
import { selectLocationState } from './Containers/App/selectors';
const history = syncHistoryWithStore(browserHistory, store, {
selectLocationState: selectLocationState(),
});
class Base extends Component {
render() {
return (
<Provider store={store}>
{children}
</Provider>
)
}
}
могли бы вы добавить код с 'getState' –
@KevinKloet GetState разрывов внутри внутри Redux-саги увидеть здесь https://github.com/yelouafi/redux-saga/blob/4ec433410c60eb1675ae786181651454fe766ddd/dist/redux-saga .js строка кода 1898 – mibbit