See this example in codesandbox
https://codesandbox.io/s/try-react-infinite-scroll-hook-4ekfj1?file=/src/App.jsx:1374-1384
This is a common pitfall when using rootMargin without root specified
Little rules of Interception Observer API:
root default to viewport while the viewport doesn't have any margin, so set rootMargin to any value will always fallback to 0px .