我的减速器被拆分,其中一个我的初始状态和减速器看起来像:
import Constants from '../constants';
const initialState = {
fetching: true,
};
const boards = (state = initialState, action) => {
switch (action.type) {
case Constants.BOARDS_FETCHING:
return state;
default:
return state;
}
};
export default boards;
如何在 BOARDS_FETCHING 情况下将 fetching 属性更改为 true?
更新
我的 .babelrc 看起来像:
{
"presets": ["react", "es2015"],
"env": {
"development": {
"presets": ["react-hmre"]
}
}
}
错误: