Sitemap
Sagar Gavhane

Sagar Gavhane

Software engineer šŸ‘ØšŸ»ā€šŸ’»loves ā¤ļø to experiment with ideas with React āš›ļø and Node.

Member-only story

3 React Performance Optimization Tips

4 min readApr 26, 2020

--

Press enter or click to view image in full size
source from https://unsplash.com/

1. Avoid passing unnecessary props to children components

Component with limited props is always performed better than component having many props. This is always a good way to drop props that are not used inside children components. Here is an example that shows a clear picture of it.

In this example, <Avatar /> component only needs image and name props. So whenever other props like username, email, or address get updated then <Avatar /> component re-renders. That's leading to a performance issue in the long term. There are many ways to drop props and this is up to you how you want to drop passing props. Here is the way I do.

2. Common fixing scenarios for object & function props

--

--

Sagar Gavhane
Sagar Gavhane

Written by Sagar Gavhane

Software engineer šŸ‘ØšŸ»ā€šŸ’»loves ā¤ļø to experiment with ideas with React āš›ļø and Node.