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: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,6 +237,7 @@ const {
237
237
overscan,
238
238
horizontal,
239
239
scrollToFn,
240
+
useObserver,
240
241
})
241
242
```
242
243
@@ -266,6 +267,11 @@ const {
266
267
- Optional
267
268
- This function, if passed, is responsible for implementing the scrollTo log for the parentRef which is used when methods like `scrolllToOffset` and `scrollToIndex` are called.
268
269
- Eg. You can use this function implement smooth scrolling by using the supplied offset and the `defaultScrollToFn` as seen in the sandbox's **Smooth Scroll** example.
270
+
-`useObserver: Function(parentRef) => ({ width: number; height: number })`
271
+
- Optional
272
+
- This hook, if passed, is responsible for getting `parentRef`'s dimensions
273
+
- Eg. You can use this hook to replace [@reach/observe-rect](https://github.com/reach/observe-rect) that `react-virtual` uses by default with [ResizeObserver API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
274
+
- Caution! Depending on your bundling target, you might need to add [resize-observer-polyfill](https://www.npmjs.com/package/resize-observer-polyfill)
269
275
-`paddingStart: Integer`
270
276
- Defaults to `0`
271
277
- The amount of padding in pixels to add to the start of the virtual list
0 commit comments