Skip to content

Resetting a query while the atomWithSuspenseQuery is not mounted results in a pending state, rather than the expected suspense state. #82

@Vakrim

Description

@Vakrim

Reproduction steps

  1. Display component subscribed to atomWithSuspenseQuery
  2. Hide component
  3. Reset query queryClient.resetQueries
  4. Display that component again

Expected state

Components suspends while refetching data

Actual behavior

useAtomValue returns query in "pending" state

Minimal reproducible example

https://codesandbox.io/p/sandbox/jotai-react-query-repro-kchwjt

Packages versions:

    "react": "18.2.0",
    "jotai": "2.8.1",
    "jotai-tanstack-query": "0.8.5",
    "@tanstack/query-core": "5.36.1",
    "wonka": "6.3.4",
    "@tanstack/react-query": "5.37.1"

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