...

/

Memoization Hooks

Memoization Hooks

Learn about ”memoization” hooks provided by React Hooks API. This lesson will cover the “useCallback” hook and “useMemo” hook examples.

What is it?

React API provides two hooks to provide the memoization feature for expensive calculations. The following two hooks will be discussed in this lesson:

  • useCallback
  • useMemo

Memoization is an optimization technique to store the result of an expensive calculation for a given input. The cached result is returned for the subsequent function calls as long as the same input occurs again.

Both useCallback and useMemo provide similar ...