Skip to content

useQuery runs twice on initial load with React 18 #3633

Closed
@facu-01

Description

Describe the bug

Using axios, if you pass the signal parameter, the api call runs twice (cancelling the first) on page reload.
I think that is the same bug that: ##3492

Your minimal, reproducible example

https://codesandbox.io/s/funny-sid-odqlqr?file=/src/App.js

Steps to reproduce

Open the network tab, refresh the Browser output and see two API calls(one cancelled).

Expected behavior

Only one api call.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

...

react-query version

v4.0.0-beta.1

TypeScript version

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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