8000 useQuery runs twice on initial load with React 18 · Issue #3633 · TanStack/query · GitHub
[go: up one dir, main page]

Skip to content

useQuery runs twice on initial load with React 18 #3633

@facu-01

Description

@facu-01

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

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

      0