You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Grid.md
+8-3
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ A windowed grid of elements. `Grid` only renders cells necessary to fill itself
22
22
| onSectionRendered | Function || Callback invoked with information about the section of the Grid that was just rendered. This callback is only invoked when visible rows have changed: `({ columnOverscanStartIndex: number, columnOverscanStopIndex: number, columnStartIndex: number, columnStopIndex: number, rowOverscanStartIndex: number, rowOverscanStopIndex: number, rowStartIndex: number, rowStopIndex: number }): void`|
23
23
| onScroll | Function || Callback invoked whenever the scroll offset changes within the inner scrollable region: `({ clientHeight: number, clientWidth: number, scrollHeight: number, scrollLeft: number, scrollTop: number, scrollWidth: number }): void`|
24
24
| overscanColumnCount | Number || Number of columns to render before/after the visible slice of the grid. This can help reduce flickering during scrolling on certain browsers/devices. |
25
+
| overscanIndicesGetter | Function || Responsible for calculating the number of cells to overscan before and after a specified range [Learn more](#overscanIndicesGetter)|
25
26
| overscanRowCount | Number || Number of rows to render above/below the visible slice of the grid. This can help reduce flickering during scrolling on certain browsers/devices. |
26
27
| rowCount | Number | ✓ | Number of rows in grid. |
27
28
| rowHeight | Number or Function | ✓ | Either a fixed row height (number) or a function that returns the height of a row given its index: `({ index: number }): number`|
@@ -147,6 +148,10 @@ function cellRangeRenderer ({
147
148
}
148
149
```
149
150
151
+
### overscanIndicesGetter
152
+
This is an advanced property.
153
+
This function is responsible for calculating the number of cells to overscan before and after a specified range. By default, React Virtualized optimizes the number of cells to overscan based on scroll direction. If you'd like to customize this behavior, you may want to fork the [`defaultOverscanIndicesGetter`](https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/defaultOverscanIndicesGetter.js) function.
154
+
150
155
### cellRenderer
151
156
152
157
Responsible for rendering a single cell, given its row and column index.
@@ -173,15 +178,15 @@ function cellRenderer ({
173
178
// Style is required since it specifies how the cell is to be sized and positioned,
174
179
// and React Virtualized depends on this sizing/positioning for proper scrolling behavior.
175
180
// By default, the grid component specifies, calculates, and initializes the following style properties:
176
-
// height
177
-
// width
181
+
// height
182
+
// width
178
183
// left
179
184
// top
180
185
// position
181
186
// You can add additional class names or style properties as you would like.
182
187
// Key is also required by React to more efficiently manage the array of cells.
0 commit comments