Skip to content

Pagination without safari component #432

@AstaDK

Description

@AstaDK

I using sajari for my demo app.

  1. I have 1 list and I want to show more items, I don't want to use the sajari component but I can't query after I change variables page.

  2. I using useSearchContext to get page and results, I cover my component with component search provider, code example bellow:
    <SearchProvider key="{index}" searchOnLoad={false} initialResponse="" search={{ pipeline: new Pipeline( { ...getConfigPipeline("") }, "query" ), variables: new Variables({ q: "", filter: "", resultsPerPage: 6, }), }} > <MyComponent/> </SearchProvider>

  3. Render result
    const { setQuery } = useQuery(); const { variables } = useVariables(); const { results, searching, totalResults, page, pageCount, } = useSearchContext();

  4. And then I use variables hook(useVariables) to set request for other page but It not request, code example bellow:
    const OtherComponent = ({ setQuery, textSearch, variables }) => { const handleShowMore = () => { variables.set({ page: page + 1, }); };

So how can set pagination without component your support?

  • I only try for used useSearch but not good for my case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions