Detect whether an element is visible in the viewport.
This is custom React hooks, you need to follow the Basic Rules when you use it.
The label follows the visibility of the box.
const useInViewport = <T extends HTMLElement = HTMLElement>() => {
ref: (element: T | null) => void
inViewport: boolean
}