Closed bcornett closed 5 years ago
Using an object that has nested properties:
{ name: '', physicalAddress: { addressLine1: '', addressLine2: '', city: '', state: '', zip: '', } }
And an component like:
<Input label="Address 1" name="physicalAddress.addressLine1" />
My errors won't show up for any physicalAddress item. I believe this is because of the way you're trying to access the errors in the helper.js on line 7 - form.errors[name].
physicalAddress
helper.js
form.errors[name]
These may be helpful: https://github.com/jaredpalmer/formik/issues/413 http://blog.nicohaemhouts.com/2015/08/03/accessing-nested-javascript-objects-with-string-key/
Using something like I mentioned in the 2nd link worked: getNested(form.errors, name)
getNested(form.errors, name)
closed in #13
Using an object that has nested properties:
And an component like:
My errors won't show up for any
physicalAddress
item. I believe this is because of the way you're trying to access the errors in thehelper.js
on line 7 -form.errors[name]
.These may be helpful: https://github.com/jaredpalmer/formik/issues/413 http://blog.nicohaemhouts.com/2015/08/03/accessing-nested-javascript-objects-with-string-key/