-
I'm creating a messaging app and I call query hooks inside the component that renders each message and once I have about 50 messages I have about 600 observers on my query. I think this is tanking performance but how do I have 600 observers even though I only have 50 messages? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
yeah 600 observers sounds excessive. Every call to |
Beta Was this translation helpful? Give feedback.
yeah 600 observers sounds excessive. Every call to
useQuery
creates one observer, so unless you have 50 components where each component has 12 useQuery calls, I don't see how you can have that many observers. Did you get the number from the devtools? Can you maybe show a minimal codesandbox reproduction?