Комментарии:
cool
Ответитьhow to solve formik yup nested object validation???
Ответитьgreat video but what about when youre using the helper function. when I try to do something like validateField('social.facebook'), it throws a weird error
Ответитьhow to add nested object in validationSchema
Ответитьjust the documentation with audio
Ответитьwe could to make a google meet ? i have a doubt..later i will pay a coffee to you
ОтветитьBro, this is exactly what I needed!!
ОтветитьIf you want to validate the nested object, you can do something like this.
const validationSchema = Yup.object(
{
name: Yup.string().required("Required"),
email: Yup.string().email("Please provide a valid email address").required("Required"),
channel: Yup.string()required("Required"),
address: Yup.string().required("Required"),
social: Yup.object().shape({
twitter: Yup.string().required("Required"),
facebook: Yup.string().required("Required")
})
}
);
maaaaaaaaaaaaaaaan you are awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ОтветитьWhat if I want to useFormik hook rather than Formik component
How can I immplement nested obj ?
Hi. Has anyone tried to use ErrorMessage for the nested fields?
I cannot seem to access if I follow the below approach
<ErrorMessage name='social.facebook' component={TextError} />
The render-props approach seems to work
<div className='form-control'>
<label htmlFor='twitter'>Twitter profile</label>
<Field type='text' id='twitter' name='social.twitter' />
</div>
<ErrorMessage name='social.twitter'>
{(errorMsg) => {
return <TextError errorMsg={errorMsg} />;
}}
</ErrorMessage>
143 like & 0 dislike. That's prove your quality of content.. great job @codevolution
ОтветитьPlz cover context api and react testing library in dept
Ответитьit's funny that that "commenst" stuck haha, that aside, this series has been great help!
ОтветитьMan I was waiting for like 4 videos for you to fix that typo, glad you got it :)!
Ответитьhow can I validate the nested object with useFormik hook
Ответитьplease make a tutorial on react router. It's a request
ОтветитьGreat job bro. I am a beginner to react and watch this series now I am so confident in form creation. Thank you so much.
ОтветитьGreat video. But what about yup validation for nested objects?
ОтветитьLooking forward for the wizard form
ОтветитьThis has been a great series - and this video came just in time! Was about to tackle a problem that will be solved with nested objects. Thanks!
Ответить