React query disadvantages
Hi, I'm still unsure about using React Query in my project because I don't know if it works well with Convex yet. For example, if I use it, will I need to handle cache invalidation myself, or does Convex take care of that? I'm still a bit confused. What are the disadvantages of using React Query with Convex?
8 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
@Slade_Wilson118 hi! nope, you don't need to worry about caching
there's some notes about this down here: https://docs.convex.dev/client/tanstack-query#differences-from-using-fetch-with-tanstack-query
Convex with TanStack Query | Convex Developer Hub
If you already use TanStack Query the query
Thanks 🫡
The main disadvantage is that our docs assume you're using the normal Convex React client libraries, so you'll have to translate some. There's not much of an advantage unless you're already familiar with React Query and want to use that interface; if you don't feel strongly about that, it's probably simple to use normal Convex React hooks.
As Jamies points out below, you do get query caching for free with React Query, which is real nice!
well, unless you're using the thing from convex helpers, the normal hooks don't cached subscriptions, right? that is one thing you get out of the box
with react-query
If you do use React Query, let me know! here or filing issues on https://github.com/get-convex/convex-react-query
👍