IntersectionObserverResult
interfaceSource L15Type contract for IntersectionObserverResult.
interface IntersectionObserverResultMembers
| Name | Type |
|---|---|
entry | IntersectionObserverEntry | null |
isIntersecting | boolean |
supported | boolean |
Open-code aq-ui React hook for Use Intersection Observer.
pnpm dlx aq-ui@alpha add use-intersection-observerImport the parts you need, then jump to an export for its contract.
"use client"
import { useIntersectionObserver } from "@/hooks/use-intersection-observer"Type contract for IntersectionObserverResult.
interface IntersectionObserverResult| Name | Type |
|---|---|
entry | IntersectionObserverEntry | null |
isIntersecting | boolean |
supported | boolean |
Open-code aq-ui React hook for Use Intersection Observer.
function useIntersectionObserver<T extends Element>(target: Target<T>, { root, rootMargin, threshold, enabled = true, freezeOnceVisible = false, onChange, }: UseIntersectionObserverOptions = {}): IntersectionObserverResultIntersectionObserverResult| Name | Type | Default |
|---|---|---|
target | Target<T> | — |
options? | UseIntersectionObserverOptions | {} |
Type contract for UseIntersectionObserverOptions.
interface UseIntersectionObserverOptions extends IntersectionObserverInit| Name | Type | Default |
|---|---|---|
enabled? | boolean | true |
freezeOnceVisible? | boolean | false |
onChange? | (entry: IntersectionObserverEntry) => void | — |
hook-observer-pools, hook-target, use-stable-callback