React Visibility
Detect when an element is becoming visible or hidden on the page.
Installation
⚠️ This plugin uses the Intersection Observer API that is not supported in every browser (currently supported in Edge, Firefox and Chrome). You need to include a polyfill to make it work on incompatible browsers.
Detech visibility with <VisibilityObserver>
component
Detech visibility with useVisibility()
Hook
Example 1
Example 2
Options
It's possible to pass the IntersectionObserver options
object using the intersection