DEV Community

Discussion on: Intersection Observer using React

Collapse
 
epresas profile image
epresas

Great job! I have one question: would this work the same between components? For example: parent component that maps inside a list of , I asume that the IO will be implemented in the parent, but do I have to create a ref for each item? Sorryif ai didn't explained myself correctly... And thanks for this post

Collapse
 
zygiss22 profile image
Zygimantas Sniurevicius • Edited

yes, you asumed correctly the parent component needs the IO and what we get there is the entire element's size of the component including the items inside or whatever we want to have there, we dont need to add to each item a ref.

Thanks for reading it!