A hook to register an intersection observer listener.
Argument | Type | Description | Default Value |
---|---|---|---|
callback | IntersectionObserverCallback | Callback that will be fired when the intersection occurs | undefined |
options | IntersectionObserverInit | Intersection Observer config (read more) | { root: null,rootMargin: "0px 0px 0px 0px", threshold: [0, 1]} |
Returns 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 our discord server! You can click the floating discord icon at the bottom right of the screen and chat with us!