CONTACT US

Before You memo()

  • Verify you’re running a production build. (Development builds are intentionally slower, in extreme cases even by an order of magnitude.)
  • Verify that you didn’t put the state higher in the tree than necessary. (For example, putting input state in a centralized store might not be the best idea.)
  • Run React DevTools Profiler to see what gets re-rendered, and wrap the most expensive subtrees with memo(). (And add useMemo() where needed.)

 

Article link copied

Close button