Fix the slow render before you fix the re-render: How to start optimizing your React app renders
#ReactJS #Performancehttps://kentcdodds.com/blog/fix-the-slow-render-before-you-fix-the-re-render …
This is true. But the DevTools tell you which components have re-renders and not what inner logic should be rewritten. Without further profiling it's always easy for people to just wrap with `React.memo` and check to see if it fixed their problem. The technique is easy.
-
-
It may be "easy" but it's hiding an underlying problem. Because eventually that component _does_ need to get re-rendered and it'll result in a janky UI when it does that. Also, slapping React.memo all over the place complicates code and can even make things slower.
-
I agree but I feel that it's an opportunity to improve tooling to help detect the granular problems easier.
- 8 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Then you can _still_ fix the unnecessary re-render if you want.