-
Notifications
You must be signed in to change notification settings - Fork 642
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
Example in a functional component #550
Comments
Hello @egor-sorokin , I will try to help you with some of your doubts :)
Haven't had time to go further into the other issues hope this helps for now |
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native": "0.64.2",
"@types/react": "^17.0.38",
"typescript": "^4.5.4"
I am trying to use the library with functional components.
I have the following screen (parent component)
then I have a FormContainer, where the library is used:
with this minimal setup, I am getting the following errors:
for
scroll.current = ref
- Type 'Element' is not assignable to type 'undefined'.for
scroll!.props.scrollToEnd(options);
- Property 'props' does not exist on type 'MutableRefObject '.for
formRef.current!.scrollToEnd({ animated: true });
- Property 'scrollToEnd' does not exist on type 'ForwardRefExoticComponent >'.Is there any way to implement this behavior with functional components? I feel
forwardRef
is needed sinceref
is used inside, once I remove it I get an error in the parent component on lineref={formRef}
: " Property 'ref' does not exist on type 'IntrinsicAttributes & Props'."The text was updated successfully, but these errors were encountered: