DEV Community

Discussion on: Don't overoptimize your React App

Collapse
 
varunprashar5 profile image
varunprashar5

^ ^ Do the profilinig and figure out what components are taking more time and then decide below things:

  1. Do code splitting (React.Lazy)
  2. React.memo
  3. useCallback
  4. useMemo
  5. Be careful about custom hook as change in the value in hook will re-render your component where it is used.
  6. Make sure you are adding relevant dependencies in your useEffect()

If using Redux, then see how many re-rendrings are happening due to it and see if you can move only those things to Redux where you actually need to pass props from React hierarchy.

It really takes good amount of time to do perfromance optimization of the App.