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

atomWithQuery - React Component unmount leads to refetch when the last fetch was unsuccessful #92

Closed
PetroTsapei opened this issue Sep 12, 2024 · 1 comment

Comments

@PetroTsapei
Copy link

The code below creates additional fetches for failed endpoints when the component unmounts.

The default situation:

  • atom created with atomWithQuery used in some Component
  • Component is mounted and fetch is executed with a failed result
  • Component gets unmounted (for example route change) and jotai unmount together with tanstack reset is executed
  • the query is still active and it will be refetched
image

@kalijonn please let me know how I can help to solve this as soon as possible. Is there a way how to disable such behaviour?

kalijonn added a commit that referenced this issue Sep 15, 2024
bug: #92 reset query via query instead of using resetQueries on client
@kalijonn
Copy link
Collaborator

fixed in #93. v0.8.8 released.

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

2 participants