QueriesObserver not working
Hello, I'm trying to use queriesObserver, but it doesn't seem to be working.
gives me error on "queryKey":
Object literal may only specify known properties, and 'queryKey' does not exist in type 'QueryObserverOptions<unknown, unknown, unknown, unknown, QueryKey>[]'.
And in browser
5 Replies
noble-gold•3y ago
what are you trying to achieve with that?
wise-whiteOP•3y ago
As I understood it's useful for getting info about the state of query, so I wanted to use it to know when it has succeeded in other part of the app, but just inlcuding it breaks the code
noble-gold•3y ago
Where did you get that information from? Obervers are a core api; for react, you usually want useQuery or useQueries. And it breaks because you're not using it correctly, it needs an array of queries passed. Anyways, you very likely don't need it
wise-whiteOP•3y ago
https://tanstack.com/query/latest/docs/react/reference/QueryObserver
I followed this 'example' for the structure (I also tried ['me'] for query keys, but thanks for response. I'll try looking for something else
noble-gold•3y ago
This is QueryObserver - you've been using QueriesObserver. Not the same thing