Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Vakrim opened this issue May 23, 2024 · 0 comments

Comments

@Vakrim
Copy link

Vakrim commented May 23, 2024

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"
@Vakrim Vakrim changed the title Reseting query while atomWithSuspenseQuery is not mounted leaves it in pending instead of suspense state Resetting a query while the atomWithSuspenseQuery is not mounted results in a pending state, rather than the expected suspense state. May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant