Skip to content

isFetching is always true when there's no internet #2361

@brunohkbx

Description

@brunohkbx

Describe the bug
When fetching a query offline and using @react-native-community/netinfo as a custom event listener the prop isFetching is always true and the prop status is success even though the request hasn't started yet.

To Reproduce
Just follow the docs here and set up onlineManager with @react-native-community/netinfo

Then when you query something:

const {
    data,
    isError,
    isFetching,
    isLoading,
    status,
  } = useQuery('todos', MyAPI.getAll, {
    placeholderData: []
  });

isFetching will be always true when there's no internet.

Expected behavior
It should be false since the request hasn't started yet I guess?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsv4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions