Using useFormikContext in Formik 2.0.1. Receiving Cannot read property 'values' of undefined when binding formik.values in the form.
useFormikContext
Formik 2.0.1
Cannot read property 'values' of undefined
Thanks in advance!...
You have to define formik inside the InnerForm() like this:
const InnerForm = () => { const formik = useFormikContext<IPerson>() return ( <form> <input name="id" value={formik.values.id} /> <input name="name" value={formik.values.name} /> </form> ); };