-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component is Re-rendering even if data is equal #1864
Comments
That is happening because your component transitions to usually, the re-renders don't matter. your component should be able to render every 10 seconds without showing impact. Imagine there are changes in the data one every poll - then you are also rendering, and need to be able to handle that :) |
This worked but is a little bit confusing:
It starts as "status" = "success" Any way I can listen to the |
well it depends on which fields your component is using. Are you also displaying an |
I updated to to latest and Uncaught TypeError: notifyOnChangeProps.some is not a function
at _loop (webpack:///./node_modules/react-query/es/core/queryObserver.js?:359) |
which version are you running? This feature was added in 3.6.0 (minor release): https://github.com/tannerlinsley/react-query/releases/tag/v3.6.0 |
I was using 3.12.0, but I think I had not rebuilt using webpack so perhaps it was just an issue due to that, it's working fine now... :) |
Problem
This polling causes re-render every time. Even if data is equal:
Even after adding this check, it still causes re-render:
Console every 10 seconds outputs:
On a different component the same occurs:
The text was updated successfully, but these errors were encountered: