Websites v4 docs v5.2.4
    Preparing search index...

    Function useLoadProperties

    • Used to render properties, loading state, a load more handler for property results and a hasNextPage state to be used to conditionally render the load more button.

      Due to search engines' inability to crawl successive search pages when using "Load More" functionality, the onLoadMore handler should be applied to a NextJS Link component instead of an HTML <button>. nextPageSearchUrl is provided to add as an href of the Link, allowing search engines to crawl subsequent search pages. onLoadMore will call e?.preventDefault() to avoid navigation by the Link, instead running the fetch request for more properties asynchronously.

      Parameters

      Returns UseLoadPropertiesResults

      const { propertiesPages, onLoadMore, loadingNextProperties, hasNextPage, nextPageSearchUrl } = useLoadProperties({
      fragment,
      channel,
      county,
      location,
      pageSize,
      });