Version: v3.6.0
#
@rooks/use-intersection-observer-ref#
A 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 |