What is useCallback, and when should you use it?

useCallback memoizes a function, preventing re-creation on every render, useful for functions passed as props to child components.

const memoizedCallback = useCallback(() => {
  doSomething(a, b);
}, [a, b]);