我使用redux-form实现提交表单:
import { reduxForm } from 'redux-form/immutable';
const Filters = ( {fields: {symbol, side, status}} ) => {
console.log(side);
export default reduxForm({
form: 'FiltersAccounts', // a unique identifier for this form
fields: ['symbol', 'side', 'status']
})(Filters);
为什么console.log会显示未定义?我错过了什么吗?
答案 0 :(得分:0)
您的代码错过了Filters
函数中的右括号。
const Filters = ( {fields: {symbol, side, status}} ) => {
console.log(side);
} // <- this was missing
reduxForm
不接受fields
配置选项,仅传递docs上列出的props