I've created a FieldWrapper that looks somewhat like this:
const MyField ({name, as: Component}) => (
<Field name={name}>
{({field: {onChange, onBlur, ...rest}, form}) => (
<Component
onBlur={onBlur(name)}
onChange={onChange(name)}
{...rest}
/>
)}</Field>
)
I'm using this to wrap external Inputs. Those Inputs don't always pass an event when firing onBlur though. I expected this to be fine by formik, because I passed the name of the corresponding field explicitly.
It turns out though that the following lines still try to access the event, even though there's no need to when the path is explicitly passed.
https://github.com/jaredpalmer/formik/blob/85d15b302cd776eb615064a4451e1a7575b1439d/src/Formik.tsx#L444-L445
Is it possible/reasonable to rewrite those lines in a way that e is not accessed when the path is passed?
Agree, I fixed this in v2. They should use the override.
Most helpful comment
Agree, I fixed this in v2. They should use the override.