-
Hey, I'm currently using useQuery in some of my list items, which results in some scenarios in hundreds of listeners. Is this a good practice or should I switch to reading directly from the cache using queryClient where possible? |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
May 24, 2024
Replies: 1 comment
-
you can't read from the queryClient during rendering. The only other option is passing data in as a prop from a parent. observers have an overhead but usually negligible. We had reports of some slowness when it goes into the thousands, but hundreds should be totally fine. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Zerebokep
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can't read from the queryClient during rendering. The only other option is passing data in as a prop from a parent.
observers have an overhead but usually negligible. We had reports of some slowness when it goes into the thousands, but hundreds should be totally fine.