Hooks
useElementVisibility

Import this in your client-side component

MyComponent.tsx
import { useElementVisibility } from "react-amazing-hooks";

API

ApiDescriptionTypeReturn TypeExample
useElementVisibilityA hook to manage the visibility state of a specific element.RefObject<Element>, numberbooleanconst isVisible = useElementVisibility(myRef, 0.5);

Check the 'Example' tab above the table for an exhaustive example.