Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created November 9, 2022 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/a64f8e37df945c0b348e2f5502d3bb66 to your computer and use it in GitHub Desktop.
Save BetterProgramming/a64f8e37df945c0b348e2f5502d3bb66 to your computer and use it in GitHub Desktop.
import { Form, Formik } from 'formik';
import React from 'react';
export const FormHolder = ({ initialValues, onSubmit, validationSchema, children}) => {
return (
<Formik
initialValues={initialValues}
onSubmit={onSubmit}
validationSchema={validationSchema}
validateOnChange={false}
validateOnBlur={ false}
enableReinitialize={true}
validateOnMount={false}
>
{() => <Form>{children}</Form>}
</Formik>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment