Skip to content

First call to useInfiniteQuery()'s fetchMore() re-fetches initial page instead of a new one #880

@danielbrauer

Description

@danielbrauer

Describe the bug
The first call to fetchMore() does not seem to actually fetch more, but instead re-fetches the initial data set.

To Reproduce

  1. Click the Fetch More button in this example a few times:
    https://codesandbox.io/s/confident-dawn-67yb2?file=/src/App.tsx
  2. Note in the console that the fetch function is called twice with the initial index: once on page load, and once with the first click of the button. Subsequent clicks appear to work as expected

Expected behavior
Every call to fetchMore() should get more data, rather than getting data we already have.

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