Replies: 3 comments
-
Your reproduction example doesn't have specific query code. I think you missed it 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I fixed it could you check again? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I made the code in Next.js which creates the post but it doesn't seem to refetch.
It works only when I refreshed the page.
I don't understand why it doesn't work. If somebody knows I'd be happy to hear you.
Your minimal, reproducible example
https://codesandbox.io/s/invalidatequries-doesnt-work-after-mutation-yuh34q?file=/src/useAddPost.ts
Steps to reproduce
async await
ininvalidateQueries
but it didn't work out.queryClient
withuseQueryClient
instead of usingnew QueryClient
to share the same instance but it didn't work out as wellHere is my useQuery code by using useInfiniteQuery for infinite scroll.
It uses same query key
QueryKeys.posts
Expected behavior
This should be refetched when navigates to '/posts'
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
None
TanStack Query version
4.0.10
TypeScript version
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions