import React from 'react'; import { Field, FieldProps } from 'formik'; import classNames from 'classnames'; import InputError from '@/components/elements/InputError'; interface Props { id?: string; name: string; children: React.ReactNode; className?: string; label?: string; description?: string; validate?: (value: any) => undefined | string | Promise; } const FormikFieldWrapper = ({ id, name, label, className, description, validate, children }: Props) => ( { ({ field, form: { errors, touched } }: FieldProps) => (
{label && } {children} {description ?

{description}

: null}
) }
); export default FormikFieldWrapper;