-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix types of components with ref forwarding #41
Comments
Hi @kowczarz, |
Seeing same issue, any progress here? What I see is that I cannot use
Error for ref is: Type '{ ref: MutableRefObject; label: string; value: string; tintColor: string; textColor: string; baseColor: string; blurOnSubmit: false; onChangeText: (text: any) => void; ... 5 more ...; filledColor: string; }' is not assignable to type 'IntrinsicAttributes & TextInputProps'. Property 'ref' does not exist on type 'IntrinsicAttributes & TextInputProps'.ts(2322) |
I do have the same issue when assigning
Any solution or workaround? |
Currently e.g.
TextInput
allows using ref, it's defined as aReact.FC<TextInputProps>
. This cause TypeScript throws the given error:Easiest solution is removing the explicit type declaration, other approach would be replacement the current type with
ForwardRefExoticComponent<PropsWithoutRef<TextInputProps>> & RefAttributes<RNTextInput>
.The reason I'm creating this issue is I don't have time to ensure if there is no other places where this issue occurs.
The text was updated successfully, but these errors were encountered: