I want to pass up values from the form to a parent component. I've looked over the docs but it's not really apparent how I would go about doing that.
For example I want to do something like this:
const MyForm = Formik({
mapPropsToValues: () => ({}),
handleSubmit: (values, bag) => props.handleSubmit(values) // ????
})
Thanks!
Obviously I wasn't looking hard enough.
Props exist on the bag…
const MyForm = Formik({
mapPropsToValues: () => ({}),
handleSubmit: (values, bag) => bag.props.handleSubmit(values)
})
Most helpful comment
Obviously I wasn't looking hard enough.
Props exist on the bag…