-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component wrapped with forwardRef cannot be used with Field component #2182
Comments
Yep. Want to make a quick PR? |
Sure. I'll do it over the weekend
…On Fri, Jan 10, 2020, 20:43 Jared Palmer ***@***.***> wrote:
Yep. Want to make a quick PR?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2182?email_source=notifications&email_token=ACPE5KSENCHYAEF6WU2QGITQ5DFXFA5CNFSM4KEJ6X7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIVAE5I#issuecomment-573178485>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPE5KXN2FL4ZVUAV65YRFTQ5DFXFANCNFSM4KEJ6X7A>
.
|
jbojcic1
added a commit
to jbojcic1/formik
that referenced
this issue
Jan 11, 2020
…forwardRef wrapped components with Field and FastField (jaredpalmer#2182)
You probably know this already but while working on this PR I noticed that CONTRIBUTING.md is a bit outdated and there are some lint issues in formik-native package so I had to commit with --no-verify flag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚀 Feature request
Current Behavior
Currently
FieldConfig
hasas
properties of typeReact.ComponentType<FieldProps<V>['field']> | keyof JSX.IntrinsicElements | React.ComponentType
andcomponent
property of typekeyof JSX.IntrinsicElements | React.ComponentType<FieldProps<V>> | React.ComponentType
, while component wrapped with forwardRef hasForwardRefExoticComponent
type so you get the ts error if you try to use wrapped component.Desired Behavior
Field should accept ForwardRefExoticComponent type too.
Suggested Solution
Extend the type to allow components wrapped with forwaredRef. So types would be something like:
as -
React.ComponentType<FieldProps<V>['field']> | keyof JSX.IntrinsicElements | React.ComponentType | ForwardRefExoticComponent<FieldProps<V>['field']>
component -
keyof JSX.IntrinsicElements | React.ComponentType<FieldProps<V>> | React.ComponentType | ForwardRefExoticComponent<FieldProps<V>>
Who does this impact? Who is this for?
Typescript users.
The text was updated successfully, but these errors were encountered: