Skip to content

React Query V4 Alpha 19 Loading State is True when enabled false #3374

@AdlerJS

Description

@AdlerJS

Describe the bug

When setting the enabled flag to false in ReactQuery v4 alpha 19 the query still goes into the loading state.

Your minimal, reproducible example

https://codesandbox.io/s/intelligent-cray-4gbrg8?file=/src/index.js

Steps to reproduce

1.) Set React Query NPM version to "react-query": "v4.0.0-alpha.19"
2.) Set enabled to false on the query
3.) Observe that query goes into loading state still with enabled false.

Expected behavior

Query should not be loading or execute when enabled false.

How often does this bug happen?

100% of the time on each render.

Screenshots or Videos

N/A see Code Sandbox link for reproduction

Platform

MacOS, Windows
Chrome, Safari, & Firefox

react-query version

"react-query": "v4.0.0-alpha.19",

TypeScript version

N/a: Applies to root level JS

Additional context

No response

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