1
<div ref={options}>
   {content}
</div>

hello, how can I catch the scroll is inside the options div? Is there any hook for this?

nwerigbxb2
  • 21
  • 3
  • 1
    [Yes there is a hook](https://github.com/streamich/react-use/blob/master/src/useScroll.ts). [Docs](https://github.com/streamich/react-use/blob/master/docs/useScroll.md) – PsyGik Sep 07 '21 at 16:44
  • [https://stackoverflow.com/questions/39325581/how-to-add-scroll-event-in-react-component](https://stackoverflow.com/questions/39325581/how-to-add-scroll-event-in-react-component) Check this answer – sojin Sep 07 '21 at 16:45
  • we have an inbuilt api for this (intersection observer). check this out : https://css-tricks.com/a-few-functional-uses-for-intersection-observer-to-know-when-an-element-is-in-view/ – RGog Sep 07 '21 at 16:48

0 Answers0