import type { FormikContext } from 'formik'; import { connect } from 'formik'; import type React from 'react'; interface IFormikFormProps { render: (props: FormikContext) => React.ReactElement; } interface IFormikFormImplProps extends IFormikFormProps { formik: FormikContext; } /** * This component provides access to the current Formik `form` props. * * This can be useful to access current form data outside of a FormField or Input. * * This component adapts the formik `connect()` api as a render prop. * * Example: * ```js * { * const username = formik.values.username; * return ( *

Hello {username}

* ) * }} /> * ``` */ const FormikFormImpl = ({ render, formik }: IFormikFormImplProps) => render(formik); export const FormikForm: React.ComponentType> = connect(FormikFormImpl);