Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import {connect} from 'formik';
const FormItem = connect(props => {
const { label, ...inputProps } = props;
const { errors, touched } = props.formik;
return (
<div>
{label && <label>{label}</label>}
<FormInput {...inputProps} />
{errors[inputProps.name] && touched[inputProps.name] && <p>{errors[inputProps.name]}</p>}
</div>
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.