how can i re-run useQuery if queryKey changed with help of props without watch and refetch?
step 1 - change 1 to 2 in input
https://codesandbox.io/p/sandbox/strange-estrela-wx59mw
actual - it is not fetch again after change number in input
expected - it should fetch again whenever queryKey or change input
2 Replies
extended-salmon•2y ago
So in your example you are passing a plain value by doing
props.postId
instead of a reactive value.
Easiet way to fix that would be to convert it ref and pass it to queryKey in that form
stormy-goldOP•2y ago
wow it works, thanks @MrMentor