React.memo prevents a component from re-rendering unnecessarily if the props have not changed. Let’s build a simple application where we pretend to call an API on the click of a button. The API returns the name and the favourite dish of the given person. Clicking on the button 10 times re-renders the Intro component 10 times.

5m read timeFrom blog.bitsrc.io
Post cover image
Table of contents
1. Don’t let the props do ‘much’ talking — React.memo2. Don’t let the callback functions do ‘much’ talking — useCallback3. Rest your processor — useMemoConclusionBuild composable frontend and backend
2 Comments

Sort: