Skip to content
Justice Tech School

useCallback

useCallback keeps a function identity stable between renders.

Example
const onPick = useCallback((id) => {
  setSelected(id);
}, []);
<Row onPick={onPick} />;

Exercise

Cache a function.

(() => {}, [])

Quiz Test

What does useCallback cache?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.