We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 354b7d1 commit d64056bCopy full SHA for d64056b
src/index.js
@@ -69,9 +69,9 @@ export function useVirtual({
69
70
useIsomorphicLayoutEffect(() => {
71
const element = parentRef.current
72
+ if (!element) { return }
73
74
const onScroll = () => {
- if (!element) return
75
const scrollOffset = element[scrollKey]
76
latestRef.current.scrollOffset = scrollOffset
77
setRange(prevRange => calculateRange(latestRef.current, prevRange))
0 commit comments