import { InfiniteScrollWithLink } from "@nosto/search-js/preact"
// With custom load more button
function LoadMoreButton({ pageSize }) {
const { loadMore } = useLoadMore(pageSize)
return (
<button
onClick={loadMore}
>
More results
</button>
)
}
<InfiniteScrollWithLink loadMoreComponent={LoadMoreButton} pageSize={defaultConfig.pageSize}>
{products?.hits?.map(hit => <Product hit={hit} />)}
</InfiniteScrollWithLink>
Infinite scroll component that loads more results when user clicks a link. *