设置初始值表单
Set initialValue formik
我目前正在使用 formik 构建表单,但是当我像这样在 initialValues 中使用嵌套对象时:
address:{title:"this a title",value:{principalAddress:"test",seconderyAddress:""}}
当我设置字段名称时,我无法访问 formik 字段中的 principalAdress
<Field component={TextField} fullWidth type="text" name="value. seconderyAddress"/>.
如果有人能帮助我,我将不胜感激。
尝试将字段名称设置为:address.value.principalAddress
<Field component={TextField} fullWidth type="text" name="address.value.principalAddress"/>
我目前正在使用 formik 构建表单,但是当我像这样在 initialValues 中使用嵌套对象时:
address:{title:"this a title",value:{principalAddress:"test",seconderyAddress:""}}
当我设置字段名称时,我无法访问 formik 字段中的 principalAdress
<Field component={TextField} fullWidth type="text" name="value. seconderyAddress"/>.
如果有人能帮助我,我将不胜感激。
尝试将字段名称设置为:address.value.principalAddress
<Field component={TextField} fullWidth type="text" name="address.value.principalAddress"/>