1 post tagged with "hooks"

View All Tags

When to useMemo and useCallback?

Bunlong

Bunlong

React Patterns Team

When to useMemo and useCallback?

React library provides us two built-in hooks to optimize the performance of our applications are useMemo and useCallback.

The usage of this two built-in hooks is quite similar so it can get confusing about when to use each. To clear that confusion, let's dig in and understand the actual difference and the correct way to use them both.