Skip to content

useSuspenseQuery's status can be "error" #9001

Closed as not planned
Closed as not planned
@Gpx

Description

@Gpx

Describe the bug

According to useSuspenseQuery's docs:

status is always success

But the type for status is "error" | "success". It should be "success" only.

Your minimal, reproducible example

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgVwM4FMCKz1QJ4A0KGAymmOgHYba55wC+cAZlBCHAEQACMAhtX4BjANYB6KOj5CYAWgCOOfJwDcAKDVCIgxHFT8YaRnAC8xLErwAKJIroBpdHgBccANoBdInfwAxSq5WAJSmAHyITAxB6mJicPEJAHoA-BpaOkj6fIaoxmZo6GSoFNQWdDZwPniOLu5elZb+gSEm4QiR0WqxCUmpQA

Steps to reproduce

  1. Invoke useSuspenseQuery
  2. Verify the type of the status property

Expected behavior

As a user, I expected the type of status for useSuspenseQuery to be "success", but I am seeing "error" | "success"

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Arc (Chromium)
  • Version: 1.89.0 (135.0.7049.42)

Tanstack Query adapter

react-query

TanStack Query version

v5.72.2

TypeScript version

v5.8.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions