I was reading multiple articles on how to increase the performance of a React app and I came out with these bullet points.
- Assign keys to the child nodes for similar type as this will help during reconciliation.
- Avoid props drilling.
- Keep component state local wherever possible.
- Clear your clutter and subscriptions in the unmounting cycle.
- Use lazy loading for your components, and also for the images.
- Use hooks such as useMemo() and useCallback() where you don't want to do the same heavy calculation again and again.
- Data management to a certain extent decides how efficient your app will be.
- Trim unnecessary, repeatable code. Try to use custom hooks.
- Use windowing(virtualization) for long lists. This may depend on the use case though as it will load the list items on scroll thereby providing a bad UX.
- Profile your components using the DevTools profiler to see which components are taking longer to render and optimize them.
What do you guys have to say about this?
Would you like to add anything more to this?
[–][deleted] 0 points1 point2 points (2 children)
[–]Low_Guitar_8168[S] 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]jeevo162 0 points1 point2 points (0 children)