This is called infinite scroll. If you don't wanna build this from the scratch, you can use external libs:
https://www.npmjs.com/package/react-infinite-scroller
https://www.npmjs.com/package/react-infinite-scroll-component
If you wanna build it yourself, you can follow these tutorials:
https://alligator.io/react/react-infinite-scroll/
https://upmostly.com/tutorials/build-an-infinite-scroll-component-in-react-using-react-hooks