Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix animatedRef on Fabric (software-mansion#4445)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary - Fixes software-mansion#4256 ### Problem If the scrollable component is not root, UI `scrollTo` doesn't work on Fabric. software-mansion#4384 - It was fixed here for Paper, but after this change app crashes on Fabric, because `getScrollableNode` in both architectures returns viewTag as a number, not component. It's working for Paper, because we are passing either component or number to `findNodeHandle` method, but on Fabric we need component ref. ### Fix Instead of `getScrollableNode`, we can use `getNativeScrollRef` and get scrollable reference. ### TODO Unfortunately this method is not implemented yet for `Flash-list` -> https://shopify.github.io/flash-list/docs/usage#:~:text=Unsupported%20methods%3A so for now, UI `scrollTo` on FlashList works only for Paper Architecture. ## Test plan ScrollToExample: - Paper, ScrollView - Paper, FlatList - Fabric, ScrollView - Fabric, FlatList --------- Co-authored-by: Tomek Zawadzki <tomasz.zawadzki@swmansion.com>
- Loading branch information