import { combineReducers } from 'redux'; import { reducer as forms } from 'redux-form'; import otherReducer from './otherReducer';
export default combineReducers({ otherReducer, forms });
请注意,我正在导入redux-form reducer
forms
,并将它传递给我的combineReducers(就像我所做的那样otherReducer
),使用ES6 Object属性值简写。问题是,关键用来传递Redux的形式减速器我们combineReducers 必须被命名为形式,所以我们必须将它更改为:
export default combineReducers({ customer, form: forms });
要么
import { reducer as form } from 'redux-form'; export default combineReducers({ otherReducer, form });
关于redux-form不能输入的问题
最新推荐文章于 2024-05-24 09:54:16 发布