Formik: Error at passing Object to HandleChange

Created on 30 Oct 2019  路  3Comments  路  Source: formium/formik

馃悰 Bug report

I'm trying to save an Object on form.values to work with it later on a Query.
The problem is, even I have used it on other project, this time it gives this error:

handleChange error

Anyone has some clue about this?

The specific line I'm inputting this is this one:
onChange={form.handleChange('MultipleSelect')({})}
where "{}" is the object I'm passing to it...

I'm not sure, but I think it is not finding the '_eventOrTextValue' function...

I have tried passing integers, objects, arrays, but the only kind of value it accepts is string... Oddly I used this same mirrored function on other project the exactly same way...

Thanks.

| Software | Version(s) |
| ---------------- | ---------- |
| Formik | ^2.0.3
| React | 16.9.0
| TypeScript | --
| Browser | --
| npm/Yarn | Yarn
| Operating System | Ubuntu 19.10

Bug

Most helpful comment

It seems that this function has changed to only handle events. For values you should use form.setFieldValue() now, it's pretty the same actually

All 3 comments

Having the same issue. This used to work fine on [email protected], I am only having this issue on Formik V2.

It seems that this function has changed to only handle events. For values you should use form.setFieldValue() now, it's pretty the same actually

We should accept object values. It's esp. an issue for third parties like React Select that expect an object value (though I question their API choice in this regard)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredpalmer picture jaredpalmer  路  3Comments

najisawas picture najisawas  路  3Comments

sibelius picture sibelius  路  3Comments

jeffbski picture jeffbski  路  3Comments

outaTiME picture outaTiME  路  3Comments