Use sparingly. There are accessibility downsides to infinite scroll.

```jsx
const fetchImages = React.useMemo(() => async (page) => {
const request = await fetch(
  `https://api.unsplash.com/photos?page=${page}`,{
    headers: {
      'Authorization': "Client-ID 6c513456b2b750b80c53dab682b8fd0a977acddba5ac98a7ec700d7c04778bdd",
      'X-Per-Page': 10
    }
  }
).then(res => res.json());
return request;
}, []);

<div style={{ maxHeight: 400, overflow: 'auto' }} id="scroll-container">
<InfiniteScroll loadFunction={fetchImages} pageLimit={3} scrollParentSelector="#scroll-container" completionMessage={<p>The End!!</p>}>
  {item => <div key={item.id}><img src={item.urls.regular} alt={item.alt_description} className="w-full mb-2" /></div>}
</InfiniteScroll>
</div>
```