발전기를 https://github.com/stylesuxx/generator-react-webpack-redux에서 사용하고 있습니다. 저장 파일에서 index.js
에서감속기가 비어있는 동안 스토어에는 유효한 감속기가 없습니다.
import { combineReducers } from 'redux';
const reducers = {};
const combined = combineReducers(reducers);
module.exports = combined;
코드 : 개발은 내가 파일을 감소에 index.js
에서 브라우저 콘솔에서 오류
warning.js:10 Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.
이 점을 제외하고 좋은 것입니다, 코드는 아래에 적혀있다 아래에 적혀있다 : 나는 현재의 개발에 REDUX를 사용하고 있지 않다
import { createStore } from 'redux';
import reducers from '../reducers';
function reduxStore(initialState) {
const store = createStore(reducers, initialState,
window.devToolsExtension && window.devToolsExtension());
if (module.hot) {
// Enable Webpack hot module replacement for reducers
module.hot.accept('../reducers',() => {
// We need to require for hot reloading to work properly.
const nextReducer = require('../reducers'); // eslint-disable-line global-require
store.replaceReducer(nextReducer);
});
}
return store;
}
export default reduxStore;
하지만 난 GENER를 사용 미래 계획을위한 구성을위한 ator. 모든 아이디어를 어떤 경고를 유발하지 않고 const reducers = {};
위의 코드와 같이 감속기를 비우는 방법을 알고 싶습니까?