Skip to content

Commit

Permalink
Update type of as and component props in FieldConfig to enable using …
Browse files Browse the repository at this point in the history
…forwardRef wrapped components with Field and FastField (#2185)
  • Loading branch information
jbojcic1 committed Jan 11, 2020
1 parent c959f47 commit 5a1ac4d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/formik/src/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ export interface FieldConfig<V = any> {
component?:
| keyof JSX.IntrinsicElements
| React.ComponentType<FieldProps<V>>
| React.ComponentType;
| React.ComponentType
| React.ForwardRefExoticComponent<any>;

/**
* Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.
*/
as?:
| React.ComponentType<FieldProps<V>['field']>
| keyof JSX.IntrinsicElements
| React.ComponentType;
| React.ComponentType
| React.ForwardRefExoticComponent<any>;

/**
* Render prop (works like React router's <Route render={props =>} />)
Expand Down

0 comments on commit 5a1ac4d

Please sign in to comment.