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.firstName = validationIsRequired(values.firstName); errors.lastName = validationIsRequired(values.lastName); return errors; }; const warn = (values) => { const warnings: MapMessages = {}; warnings.lastName = validationMinLength(values.lastName); return warnings; }; const Step1Component = (props) => { const {handleSubmit} = props; return (
); }; const Step1 = reduxForm({ form: 'step1', wizard: 'wizardExample', validate, warn, destroyOnUnmount: false, })(Step1Component); export default Step1;