Version: v4.4.0
use-intersection-observer-ref
#
AboutA hook to register an intersection observer listener
#
Installation#
Importing the hook#
Usage#
ArgumentsArgument | Type | Description | Default Value |
---|---|---|---|
callback | IntersectionObserverCallback | React ref whose boundingClientRect is to be found | undefined |
options | IntersectionObserverInit | React ref whose boundingClientRect is to be found | { root: null,rootMargin: "0px 0px 0px 0px", threshold: [0, 1]} |
#
ReturnReturns an array with the first element in the array being the callback ref for the React component/element that needs to be observed.
Return value | Type | Description | Default value |
---|---|---|---|
ref | CallbackRef | ref for the React component/element that needs to be observed. | null |
#
Join Bhargav's discord serverYou can click on the floating discord icon at the bottom right of the screen and talk to us in our server.