Back to journals
Loading article…
Journals
Short notes and snippets — too brief for a full blog post, worth writing down.
Back to journals
Back to journals
TIL
With the React Compiler enabled, manual memoization is usually noise — let the compiler prove stability.
Date published
## The lesson
React 19's compiler analyzes component render paths and inserts memoization where it can prove it helps.
```tsx
function UserList({ users }: { users: User[] }) {
const sorted = users.toSorted((a, b) => a.name.localeCompare(b.name));
return sorted.map((user) => <UserRow key={user.id} user={user} />);
}
```
No `useMemo` wrapper needed — the compiler handles it when dependencies are stable.
[!TIP]
Reach for `useMemo` only after profiling shows a real bottleneck.