嗨,我想为大写实现表单规范化,就像这里Normalizing Form Data
const reducer = combineReducers({
// other reducers
form: form.normalize({
normalizing: { // <--- name of the form
upper: value => value && value.toUpperCase(), // normalizer for 'upper' field
phone: normalizePhone, // normalizer for 'phone' field
min: normalizeMin, // normalizer for 'min' field
max: normalizeMax // normalizer for 'max' field
}
})
});
我有 100 个字段,我不想写每个字段,而是传递某种数组,类似的东西。
const reducer = combineReducers({
// other reducers
form: form.normalize({
normalizing: { // <--- name of the form
fieldsArray: value => value && value.toUpperCase(), // normalizer for 'upper' field
}
})
});
如何实现?