ideas icon indicating copy to clipboard operation
ideas copied to clipboard

useIntersectionObserver

Open jamiebuilds opened this issue 5 years ago • 3 comments

  • https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

Not sure exactly how best to do this. It seems like you might want to use context to get the scrollable container ref, and then some sort of useObserve(ref) API which gets the observer from context and then tells you information about the elements status.

Maybe?

jamiebuilds avatar Oct 25 '18 20:10 jamiebuilds

I would like to work on it.

AjayPoshak avatar Oct 26 '18 06:10 AjayPoshak

@AjayPoshak still interested? I took a stab at it https://github.com/TejasQ/react-hook-intersection-observer. We can collaborate if you still are.

I wasn't sure since it's been nearly a month since your comment and I haven't seen an update yet. I hope you don't feel like I'm stealing your thunder or anything. I had a legitimate use case where I needed to build this. 😄

TejasQ avatar Nov 20 '18 08:11 TejasQ

@TejasQ I am totally cool with it. I don't have time to do it. So yes, please go ahead and add it.

AjayPoshak avatar Dec 07 '18 04:12 AjayPoshak