batching notifications to avoid rerenders #983
Unanswered
jindal-git
asked this question in
General
Replies: 1 comment 1 reply
-
I am also facing this same issue.. Please let me know of any solution . |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
We use react-query to manage server side state, so we have multiple hooks in the hooks tree fetching the same query. When the query resolves, we get one render for every useQuery call in the hooks tree. This results in explosions of re-renders for a large hooks tree. See the minimal example below that shows 3 renders instead of 2.
https://codesandbox.io/s/hardcore-forest-5rg07?file=/src/index.js
Is this fundamental to how react-query works? Can it be improved batching notifications?
Beta Was this translation helpful? Give feedback.
All reactions