Consider generalizing onScrollElement
to support EventTarget
instead of HTMLElement
#204
Unanswered
liaujianjie
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since
onScrollElement
is only used to mount thescroll
event listener, I suggest typing theonScrollElement
property on theuseVirtual
hook option asReact.RefObject<EventTarget>
as opposed to the existingReact.RefObject<HTMLElement>
. This enables thewindow
ordocument
objects to also be used as the scroll container.I can open up a simple type change PR for this if my suggestion is within the scope of this library. :-)
How I'm using it
Beta Was this translation helpful? Give feedback.
All reactions