allow dot path & bracket path for setFieldValue, setFieldTouched, & setFieldError
Bug
The exposed interface for setFieldValue, setFieldTouched, & setFieldError do not allow dot path names
Current Behavior
only first level field names can be set.
Desired Behavior
allow field names that contain dot path as well as bracket path.
Suggested Solutions
change the keyof Values type for the field argument to string
Info
- Formik Version: 0.11.0-beta.1
- OS: MacOS High Sierra 10.13.2
- Node Version: 8.9.4
- Package Manager and version: npm 5.6.0
along the same vein, the values in type FormikTouched should not be typed to boolean, as this only allows us to access top level touched fields.
(e.g. touched.parent, but not touched.parent.child)
actually, this is resolved and this improvement can be closed :)

This has been working in javascript, but not Typescript. In Typescript, we have to cast to any:
setFieldTouched('property.child' as any)
I'm just proposing that we change the signature of FormikActions<Values> from:
setFieldValue: (field: keyof Values, value: any) => void;
setFieldError: (field: keyof Values, message: string) => void;
setFieldTouched: (field: keyof Values, isTouched?: boolean) => void;
to:
setFieldValue: (field: string, value: any) => void;
setFieldError: (field: string, message: string) => void;
setFieldTouched: (field: string, isTouched?: boolean) => void;
@weswigham is there is good way to do this other than just a string?
I'd just add a second overload that takes a string argument for when you pass something that isn't a direct key. There's no way in the typesystem today to concatenate strings, so there's no way to represent a full object path string as a type.
please do the same for FormikTouched<Values>. same problem - we can't access anything beyond top level values in touched