2021-02-18
1598
#react
Adebola Adeniran
34347
Feb 18, 2021 â‹… 5 min read

React.memo vs. useMemo: Major differences and use cases

Adebola Adeniran Hi! I'm Adebola! I'm a full-stack React/Node.js and Ruby on Rails engineer from Nigeria. I mentor junior developers via the Google Developer Program, and I'm a regular contributor to some of the most widely read programming blogs. You can follow me on Twitter @debosthefirst.

Recent posts:

Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 min read
JavaScript logo on top of violet background

Exploring essential DOM methods for frontend development

Learn four groups of DOM methods and their uses to create responsive and dynamic webpages. A helpful DOM reference table is also included.

Chimezie Innocent
Jul 23, 2024 â‹… 12 min read
View all posts

2 Replies to "<code>React.memo</code> vs. <code>useMemo</code>: Major differences and use cases"

  1. Nice easy to read article. But I think you should make it clear that React.memo and useMemo are completely different: the functional component is always being rerendered, which is rexecuted with the same props, as can be seen from react tools/highlight rerenders (even though with no dom changes to perform to perform in this particular case).

  2. In your useMemo use case, does it mean no re-rendering if UseMemoCounts component shows the same times when clicking cheese buttons? ParentComponent sends the same value as a prop to UseMemoCounts. It just shows the same number and it keeps re-rendering, doesn’t it?

Leave a Reply