useToggleuseToggle+useEventRefuseSafeEffectuseEventControluseDebounceuseThrottleuseClickOutsideuseTabsuseDateuseDatesuseImageuseCaptureuseIntersectionObserver
react react-hook ironman30

useIntersectionObserver

A hook to add intersectionObserver with element.


LINKS

鐵人賽文章


const ref = useIntersectionObserver(callback, options)
const [ref, isInView] = useInView(options)

[Yellow Box] Not in view...[Green Box] Not around[Blue Box] Not in view...

0

0.5

1.0

0

0.5

1.0

0

0.5

1.0

0

0.5

1.0

0

0.5

1.0

0

0.5

1.0

0

0.5

1.0