-
Notifications
You must be signed in to change notification settings - Fork 21
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
useSuspenseQuery is not refreshing the data #76
Comments
Hey thanks for the issue. I'm using this hook in my own web app, and it should absolutely re-trigger the query, and refresh the results when the query variables change. If you could put together a repro on StackBlitz (or wherever, but Stack Blitz is probably the best option) I'd be happy to look into it. |
@Kostanos Looking at the source for useSuspenseQuery ... the best I can think of is that maybe you're setting the |
Hey, no, I'm not using the active variable in this case. And as I mentioned, the query itself was sent to the server (with active=false, the query will not be send), and has a updated result. But the data variable is not updated. |
Ah yeah - you did say that. That's really crazy. Hope you can get a repro - eager to see what this is. |
Hey, I found the issue with useSuspenseQuery, and I can't find a workaround for it yet, can you please help?
When I use useSuspenseQuery, everything works as expected when user navigates from another views,
but, if user navigates to the same view with different set of parameters, the useSuspenseQuery actually triggers the query, but do not update the data variable.
navigate from Home to Listing view:
navigate from Listing to Listing with different variables, example page=2 or query="some search"
The data is never refreshed with a new array that came from the server.
Is user navigates away from the view and come back, the data refreshes as expected.
PS. I use
const navigate = useNavigate(); navigate('new path');
for the navigationThe text was updated successfully, but these errors were encountered: