@nosto/search-js
    Preparing search index...

    Function InfiniteScrollWithLink

    • Infinite scroll component that loads more results when user clicks a link. *

      Parameters

      Returns Element

      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>