You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating one project and I find this library very useful. I need to use scrollTo function from native ScrollView. Because of that, I need the possibility to set ref and use scrollTo function. Can you do this?
The text was updated successfully, but these errors were encountered:
You can expose ref by yourself in your local package files.
Inside package files in KeyboardAvoiderScrollView.tsx add the following line in props type definition:
// * node_modules/@good-react-native/keyboard-avoider/src/components/KeyboardAvoiderScrollView.tsxtypeProps=ScrollViewProps&CommonProps&{/** * What to do when the keyboard hides on iOS. * @option 'stay' - *Default* scroll view will not move when the keyboard hides (it will stay where it is.) * @option 'revert' - Scroll view will return to its original position when the keyboard hides. */iosHideBehavior?: 'stay'|'revert',scrollViewRef?: AnimatedRef<AnimatedScrollView>;//<- this line}
Then change the ref to be passed prop in line 39:
constscrollviewRef=props.scrollViewRef;
To create ref in parent component write the code as below and then pass it to KeyboardAvoiderScrollView component:
Hello,
I am migrating one project and I find this library very useful. I need to use scrollTo function from native ScrollView. Because of that, I need the possibility to set ref and use scrollTo function. Can you do this?
The text was updated successfully, but these errors were encountered: