New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setErrors can not set nested field errors #3369
Labels
Comments
@vishalgheravada , can you share a codesanbox link or something similar? |
I have the same issue. |
using object worked for me: setErrors({ parent: { child: 'error msg' } }); |
If you are faced with a multi-level nested field, one possible solution is to convert the error object as follows
|
Not working for me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
i have a component in form like this:
<Field name="detail.firstName" />
I get errors from api as below:
{'detail.firstName': 'some error msg', 'type': 'some error msg'}
setErrros from submit function only sets
type
msg notfirstName
.I can only achieve this by using
setFieldError
in loop.Also, I can see formik context is getting updated too.
is there any way I can do that without using a loop?
Your environment
The text was updated successfully, but these errors were encountered: