import React from 'react'; import {Field, reduxForm} from '../../index'; const validationIsRequired = (value) => !value ? 'Field required.' : undefined; const validationMinLength = (value) => value && (value.length < 2) ? 'The minimum length of the value must be 2.' : undefined; const validate = (values) => { const errors: MapMessages = {}; errors.phone = validationIsRequired(values.phone); errors.email = validationIsRequired(values.email); return errors; }; const warn = (values) => { const warnings: MapMessages = {}; warnings.email = validationMinLength(values.email); return warnings; }; const Step2Component = (props) => { const {handleSubmit, prevPage} = props; return (
); }; const Step2 = reduxForm({ form: 'step2', wizard: 'wizardExample', validate, warn, destroyOnUnmount: false, })(Step2Component); export default Step2;