All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

The Overuse of useCallback and useMemo in React

By

0xedb

10mo ago· 7 min readenOpinion

Summary

The article critiques the overuse of `useCallback` and `useMemo` in React, arguing that these memoization techniques are often applied unnecessarily. The author highlights that memoization should only be used for performance optimization when something is genuinely slow, rather than as a default practice. The piece aims to educate developers on when and why to avoid unnecessary memoization.

Key quotes

· 3 pulled
Why memoize? There's usually only two reasons to create a memoized version of a function with useCallback or a value with useMemo: Performance optimization.
Something is slow, and slow is usually bad. Ideally, we'd make it faster, but we can't always do that. Instead, we can try to do that slow thing less often.
I thought I'd written enough about memoization by now, but I feel there is one pattern I'm seeing a lot lately that makes me think otherwise.
Snippet from the RSS feed
Why most memoization is downright useless...

You might also wanna read