diff --git a/documentation/docs/fundamentals/usage.md b/documentation/docs/fundamentals/usage.md index 0002be437..2065a9ed5 100644 --- a/documentation/docs/fundamentals/usage.md +++ b/documentation/docs/fundamentals/usage.md @@ -875,12 +875,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 };