From 97974c51f893554663fbf05ebd5d7164fe97441c Mon Sep 17 00:00:00 2001 From: Marko Kajzer Date: Sat, 24 Jan 2026 22:20:23 +0900 Subject: [PATCH] docs: remove references to non-existing methods --- documentation/docs/fundamentals/usage.md | 4 ++-- documentation/docs/v2-changes.md | 2 +- src/FlashListRef.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/docs/fundamentals/usage.md b/documentation/docs/fundamentals/usage.md index 4c765f4b6..97ada3d11 100644 --- a/documentation/docs/fundamentals/usage.md +++ b/documentation/docs/fundamentals/usage.md @@ -862,12 +862,12 @@ Param `offset` expects the offset to scroll to. In case of `horizontal` is true, Param `animated` (`false` by default) defines whether the list should do an animation while scrolling. -### `getVisibleIndices()` +### `computeVisibleIndices()` Returns an array of indices that are currently visible in the list. ```tsx -getVisibleIndices(): number[]; +computeVisibleIndices(): number[]; ``` ### `getLayout()` diff --git a/documentation/docs/v2-changes.md b/documentation/docs/v2-changes.md index f2b30bfaa..38a4119ff 100644 --- a/documentation/docs/v2-changes.md +++ b/documentation/docs/v2-changes.md @@ -80,7 +80,7 @@ sidebar_position: 4 - FlashList does not ask for any estimates, which makes it much easier to use. - Horizontal Lists are much improved, and items can also resize within the lists. We no longer render an extra item to measure list height. - In Grid layout, if side-by-side items have different heights, then the shorter item will match the height of the tallest item. This wasn't possible in v1. -- The ref of FlashList has many more useful methods like `getVisibleIndices` and `getLayout`. +- The ref of FlashList has many more useful methods like `computeVisibleIndices` and `getLayout`. - `contentContainerStyle` prop is fully supported now. ## New hooks diff --git a/src/FlashListRef.ts b/src/FlashListRef.ts index 07bac2aa2..1ff7acca4 100644 --- a/src/FlashListRef.ts +++ b/src/FlashListRef.ts @@ -266,7 +266,7 @@ export interface FlashListRef { * @returns An object with startIndex and endIndex properties * * @example - * const { startIndex, endIndex } = listRef.current?.getVisibleIndices(); + * const { startIndex, endIndex } = listRef.current?.computeVisibleIndices(); * console.log(`Visible items: ${startIndex} to ${endIndex}`); */ computeVisibleIndices: () => { startIndex: number; endIndex: number };