React Formik Tutorial - 40 - Registration Form

preview_player
Показать описание

📱 Follow Codevolution

Registration Form in React with Formik
Рекомендации по теме
Комментарии
Автор

In case anyone else comes across the problem I did when doing the conditional validation for the phone number field. After refactoring a few times I was getting the error "branch is not a function". The current version of Yup requires two things to correct this error:

You need to had .shape to the Yup.object() before adding the properties:
const validationSchema = Yup.object().shape({

Secondly, the then: value needs to return a function:
phone: Yup.string().when("modeOfContact", {
is: "telephonemoc",
then: () =>

Making these two corrections should resolve any issues you may be having!

battlebra
Автор

thanks so much Vishwas, i learn a lot things

aoNguyen-ymsp
Автор

getting error on Yup .string on then phone number, to fix that need to pass the then as function, phone: Yup.string().when('modeOfContact', {
is: 'telephonemoc',
then:
})

kannymohammed
Автор

Hey, I see some react-router activities in your GitHub when can we expect some of that?

shomikghosh
Автор

I am wondering why do we need to use <FormikControl /> here? Can't we just use <Input / > and <Radio /> and pass the properties directly?

xiaotutu
Автор

Hi Sir,
Can you please make tutorials series on React Router .
It is missing in your tutorials

vaibhavjain
Автор

Hi @Codevolution, Could you please help me to understand how can I maintain the state of the form even if the component is rendering again. I mean store the formik in mobx

gajanangaikwad
Автор

Hi Sir,
can you tell me which vscode plugin you use?

小川-gb
Автор

Hello Sir, I am not able to change the value of the state logged_in: true in navbar . I have created a login signup and want to update the navbar login button or logout button according to auth

shashankkumar