0
votes

I am currently using formik to build a form, but when I use nested object inside initialValues like this : address:{title:"this a title",value:{principalAddress:"test",seconderyAddress:""}}

I can't access to principalAdress in formik field when I set the name of the field

<Field component={TextField} fullWidth type="text" name="value. seconderyAddress"/>.

if there s someone who can help me I will be thankful.

1
please share your entire initialValues objectthedude
@thedude i share it .khaliloos benk

1 Answers

0
votes

Try setting the Field's name to: address.value.principalAddress

<Field component={TextField} fullWidth type="text" name="address.value.principalAddress"/>