Skip to content

[v2] initialData does not work if query is dynamic #650

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

Closed
huchenme opened this issue Jun 28, 2020 · 1 comment
Closed

[v2] initialData does not work if query is dynamic #650

huchenme opened this issue Jun 28, 2020 · 1 comment

Comments

@huchenme
Copy link

huchenme commented Jun 28, 2020

Describe the bug

For my app, as the initial data was saved in local storage, I do not wish to make network call and show spinner. After upgrade to v2, I noticed that the app stuck at isLoading equal to true
https://codesandbox.io/s/react-query-2-initialdata-k1gpk

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/react-query-2-initialdata-k1gpk
  2. Change the dropdown to "weekly"
  3. Change the dropdown to "monthly"

Expected behavior
It should load the data in for weekly and monthly

Actual behavior
Data does not change

Desktop (please complete the following information):

  • OS: [e.g. iOS]: macOs catalina
  • Browser [e.g. chrome, safari]: chrome
  • Version [e.g. 22]: 83

Additional context
I tried another approach using setQueryData, it was working in v1, issue here: #649

@tannerlinsley
Copy link
Collaborator

Please see my response in #649

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