Adebola Adeniran
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:

Exploring Stylex And The New Generation Of Styling Libraries

Exploring StyleX and the new generation of styling libraries

StyleX is a build-time, type-safe CSS-in-JS library recently open sourced by Meta. Explore StyleX and the evolution of styling libraries.

Ibadehin Mojeed
Feb 29, 2024 ⋅ 9 min read
Building High Performance Ecommerce Sites With Astro

Building high-performance ecommerce sites with Astro

Learn to set up a completely custom Astro ecommerce implementation that’s also highly performant and type-safe in this straightforward guide.

Onuorah Bonaventure
Feb 28, 2024 ⋅ 64 min read
Implementing Vector Search With Open Ai, Next Js, And Supabase

Implementing vector search with OpenAI, Next.js, and Supabase

Let’s build a Next.js app that implements vector search using Supabase and OpenAI to offer better search experiences for users.

Peter Ekene Eze
Feb 27, 2024 ⋅ 11 min read
Comparing React Native BLE libraries

Comparing React Native BLE libraries

Discover the most popular libraries for enabling Bluetooth Low Energy (BLE) in React Native apps, allowing them to interact with Bluetooth hardware on iOS and Android platforms.

Fimber Elemuwa
Feb 26, 2024 ⋅ 4 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