Skip to content
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 #1041

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Added `getNativeScrollRef`
- https://github.com/Shopify/flash-list/pull/1041

## [1.6.3] - 2023-11-09

- Changes for RN 0.73 support
Expand Down
1 change: 0 additions & 1 deletion documentation/docs/fundamentals/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ Unsupported methods:
- [`flashScrollIndicators()`](https://reactnative.dev/docs/flatlist#flashscrollindicators)
- [`hasMore`](https://reactnative.dev/docs/virtualizedlist#hasmore)
- [`getChildContext`](https://reactnative.dev/docs/virtualizedlist#getchildcontext)
- [`getNativeScrollRef()`​](https://reactnative.dev/docs/flatlist#getnativescrollref)
- [`getScrollRef`](https://reactnative.dev/docs/virtualizedlist#getscrollref)
- [`getScrollResponder()`](https://reactnative.dev/docs/flatlist#getscrollresponder)

Expand Down
4 changes: 4 additions & 0 deletions src/FlashList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,10 @@
return this.rlvRef?.getScrollableNode?.() || null;
}

public getNativeScrollRef(): number | null {
return this.rlvRef?.getNativeScrollRef?.() || null;

Check failure on line 831 in src/FlashList.tsx

View workflow job for this annotation

GitHub Actions / Build Typescript

Property 'getNativeScrollRef' does not exist on type 'RecyclerListView<RecyclerListViewProps, any>'.

Check failure on line 831 in src/FlashList.tsx

View workflow job for this annotation

GitHub Actions / Metro bundling for iOS

Property 'getNativeScrollRef' does not exist on type 'RecyclerListView<RecyclerListViewProps, any>'.

Check failure on line 831 in src/FlashList.tsx

View workflow job for this annotation

GitHub Actions / Run iOS e2e tests

Property 'getNativeScrollRef' does not exist on type 'RecyclerListView<RecyclerListViewProps, any>'.
}

/**
* Allows access to internal recyclerlistview. This is useful for enabling access to its public APIs.
* Warning: We may swap recyclerlistview for something else in the future. Use with caution.
Expand Down
Loading