From 5a1ac4d6b27f04d9b1d3e23467519016cbf2cd82 Mon Sep 17 00:00:00 2001 From: Josip Bojcic Date: Sat, 11 Jan 2020 10:12:24 +0100 Subject: [PATCH] Update type of as and component props in FieldConfig to enable using forwardRef wrapped components with Field and FastField (#2185) --- packages/formik/src/Field.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/formik/src/Field.tsx b/packages/formik/src/Field.tsx index 515786b1c..1c081da9a 100644 --- a/packages/formik/src/Field.tsx +++ b/packages/formik/src/Field.tsx @@ -24,7 +24,8 @@ export interface FieldConfig { component?: | keyof JSX.IntrinsicElements | React.ComponentType> - | React.ComponentType; + | React.ComponentType + | React.ForwardRefExoticComponent; /** * Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component. @@ -32,7 +33,8 @@ export interface FieldConfig { as?: | React.ComponentType['field']> | keyof JSX.IntrinsicElements - | React.ComponentType; + | React.ComponentType + | React.ForwardRefExoticComponent; /** * Render prop (works like React router's } />)