1 import type { ComponentProps, ComponentType, ReactNode } from 'react';
3 import type { FieldValidator, FieldProps as FormikFieldProps } from 'formik';
4 import { Field as FormikField } from 'formik';
6 type Props<T extends FormikFieldProps> = {
7 component: ComponentType<T>;
9 validate?: FieldValidator;
11 } & (T extends infer U ? Omit<ComponentProps<ComponentType<U>>, keyof FormikFieldProps> : never);
13 export const Field = <T extends FormikFieldProps>(props: Props<T>) => <FormikField {...props} />;