Multiple re-renders #2416
-
Hey, I display some data based on a filter but I have noticed that multiple unnecessary re-renders are occuring. See this example which is pretty close to my own use case: https://codesandbox.io/s/sleepy-worker-84et8?file=/src/Films.js If you open up the console and then click the "A new hope only" butto you will see the component re-renders 3 times even though the I know that calling Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I’m on mobile, but it’s most likely due to the |
Beta Was this translation helpful? Give feedback.
I’m on mobile, but it’s most likely due to the
isFetching
transition. I’ve written about what that is and what to do against it here: https://tkdodo.eu/blog/react-query-render-optimizations