//import {Field, Form, Formik} from "formik";
// import * as Yup from "yup";
<Formik
enableReinitialize
initialValues={calculatedFormInitialValues}
validate={values => {
let errors = {};
if (values.responsible_user === "" && values.responsible_department === "") {
errors.responsible_user = "One of these is required";
errors.responsible_department = "One of these is required";
}
return errors;
}}
validationSchema={Yup.object().shape({
first_name: Yup.string()
.required('Required'),
})}
onSubmit={values => {
}}
>
{({errors, touched, values}) => {
return (
<Form>
<Field name='first_name' component={InputFieldFormik}
placeholder={'First Name'}/>
</Form>
)
}}
</Formik>
Last active
December 3, 2019 12:00
-
-
Save shahab65/5e4556f161897a124dcb836b0eca4e8e to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment