-
Notifications
You must be signed in to change notification settings - Fork 427
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
Implement getNativeScrollRef
#776
Implement getNativeScrollRef
#776
Conversation
@@ -25,4 +25,9 @@ export default abstract class BaseScrollComponent extends React.Component<Scroll | |||
public getScrollableNode(): number | null { | |||
return null; | |||
} | |||
|
|||
//Override and return ref to your custom scrollview. Useful if you need to use Animated Events on the new architecture. | |||
public getNativeScrollRef(): unknown | null { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be unknown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really remember why I made it this way. Updated to match the type of FlatList
.
Getting Typescript errors, can you check? @j-piasecki |
bd31f4e
Now I remember why it was
I solved it by:
|
Thanks @j-piasecki! |
This PR adds implementation for
getNativeScrollRef
. It's required for compatibility withreact-native-reanimated
on the new architecture: https://github.com/software-mansion/react-native-reanimated/blob/720fefba7cd53471e98d52282c783701233861a7/src/reanimated2/hook/useAnimatedRef.ts#L26-L33