Replies: 1 comment
-
Yes, this is actually best practice, because react-query will the cache each result independently. If you need it for the fetcher, put it in the key:
|
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.
-
I should use react-query for a filterable list, but can I use a big object as query key? something like:
then:
const list = useQuery(['list', filters], fetcher());
Is this best practice and logical or not? do you have any idea?
Actually, current code updates list by any changes on the filters, we store this object in local state and refetch by new changes.
Beta Was this translation helpful? Give feedback.
All reactions