Skip to content

If "initialStale" is setted or return true, 'isFetching' will be true and 'data' will be undefined when the key is changed #927

@TIS-OMiddle

Description

@TIS-OMiddle

Describe the bug
The initialStale behavior is strange. When initialStale is false and query key is changed, isFetching will always be true, and data will always be undefined

To Reproduce
Steps to reproduce the behavior:

  1. codesandbox: https://codesandbox.io/s/rq-initialstale-xg9u2?file=/src/index.js:444-456
  2. Click 'add' button

Expected behavior
Not sure what it should be.
I think initialStale should not be called multiple times, and data should be an object.

Screenshots
image

Desktop (please complete the following information):

  • OS: Mac
  • Browser: Chrome
  • Version: 84.0.4147.125

Additional context
Add any other context about the problem here.

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