DEV Community

Discussion on: Tracking Scroll Position With React Hooks

Collapse
 
iiapdev profile image
iiap_dev

Hi! Could you explain why you don't pass element here and why you use curly braces for useWindow?

const position = useRef(getScrollPosition({ useWindow }))

I'm getting error if I try to do the same. Thanks!