-
-
Save tdeekens/4366d20fdfc49ce924540f472bd25f33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DiscountCodeNameField = props => ( | |
<React.Fragment> | |
<TextInput | |
name="name" | |
value={props.formik.values.name} | |
hasError={Boolean( | |
props.formik.touched.name && props.formik.errors.name | |
)} | |
onChange={props.formik.handleChange} | |
onBlur={props.formik.handleBlur} | |
isDisabled={props.formik.isSubmitting} | |
/> | |
<ValidationError.Switch | |
errors={props.formik.errors.name} | |
isTouched={props.formik.touched.name} | |
> | |
<ValidationError.Match rule="required"> | |
<ErrorMessage> | |
<FormattedMessage {...messages.required} /> | |
</ErrorMessage> | |
</ValidationError.Match> | |
</ValidationError.Switch> | |
</React.Fragment> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment