Skip to content

Data clear even with keepPreviousData option on useInfiniteQuery #959

@jansedlon

Description

@jansedlon

Describe the bug
When using useInfiniteQuery with argument sent to a resolver function, enabled: false and keepPreviousData: true, data are deleted when one of arguments are changed.

To Reproduce
Steps to reproduce the behavior:

  1. Create useInfiniteQuery with some argument that is changing
  2. Set enabled: false and keepPreviousData: true
  3. Fetch some data
  4. Change the argument
  5. Data are gone

Expected behavior
Data should remain

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: firefox
  • Version: 68

Additional context
react-query version: 2.14.1

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