From ed0b15d58731ee423476d782112d13f3c6ae92b5 Mon Sep 17 00:00:00 2001 From: JulienIzz Date: Thu, 29 Aug 2024 15:58:40 +0200 Subject: [PATCH] doc: add doc on nbOfRenderedItems --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 417b2dd4..9c298819 100644 --- a/docs/api.md +++ b/docs/api.md @@ -240,7 +240,7 @@ It also ensures that the scroll event is propagated properly to parent ScrollVie | `data` | `Array` | The array of data items to render. ⚠️ You should memoize this array for maximum performance. A costly memo depends on it. | | `renderItem` | `(args: { item: T }) => JSX.Element` | A function that returns the JSX element to render for each item in the data array. The function receives an object with the item as a parameter. | | `itemSize` | `number \| ((item: T) => number)` | In case you specify a number it will behave like this : ff vertical, the height of an item; otherwise, the width. You can also specify a function which needs to return for each item of `data` its size in pixel in order for the list to handle various item sizes. ⚠️ You should memoize this function for maximal performances. An important memo depends on it. | -| `numberOfRenderedItems` | `number` | The number of items to be rendered (virtualization size). | +| `numberOfRenderedItems` | `number` | The number of items to be rendered (virtualization size). ⚠️ It must be at least equal to `numberOfItemsVisibleOnScreen +2` or when using jump-on-scroll : `(2 * numberOfItemsVisibleOnScreen) + 1` to ensure correct rendering. | | `numberOfItemsVisibleOnScreen` | `number` | The number of items visible on the screen. This helps determine how to slice the data and when to stop the scroll at the end of the list. | | `onEndReached` | `() => void` | An optional callback function that is called when the user reaches the end of the list. Helps with pagination. | | `onEndReachedThresholdItemsNumber` | `number` | The number of items left to display before triggering the `onEndReached` callback. Defaults to 3. |