Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    The sandbox is unavailable. The problem is likely useQuery receives just a value, it cannot be reactive. Providing too much data (postToFetch) is design mistake any way. Make id a ref and pass it like queryKey: ['post', id], this is what refs are for, to pass a value by reference Commented Sep 5, 2023 at 11:58
  • @EstusFlask passing the ref & not unpacking it while setting the queryKey solved the issue. I got your point about the design mistake to pass too much data! Sandbox is updated Commented Sep 6, 2023 at 18:06