Redux-form provides a reducer that manages the form's state. Add this to the combineReducers. It is important to specify the state reducer key as form for redux-form to work
Redux-form provides a redux-form wrapper to pass your component props as callbacks (resetForm, handleSubmit) and form data (error, dirty, fields, submitting). View the full list of props.
exportdefaultreduxForm({ form:'formKey',// form key must be unique fields: ['name','email'] // form fields... validate // custom form validation function})(Form)
Form
The fields props contains the field values (i.e. name, email) and several event listeners for each field, so these must be passed into the input tag for the specific field via {...name}.
For submission of form data, the handleSubmit prop is passed to the onSubmit or onClick and will complete any validations before calling this.props.onSubmit(data). You can also pass a function into handleSubmit to be called, so handleSubmit(submit).
The validate function will be called on each render cycle and will be passed the a form values object where the function must return an errors object with the specific error message for each field.