useMemo and useCallback

Syntax

1
const memoValue = useMemo(callback, optionalArgumentList);
Copied!
Where :
  1. 1.
    memoValue : Return memorized by useMemo.
  2. 2.
    callback: Function that is executed one or more times according to optionalArgumentList.
  3. 3.
    optionalArgumentList: Array of arguments that controls the execution of callback, if an argument of optionalArgumentList changes it will trigger that callback is executed again.

useCallback

Hook that allows you to memorize a callback so that it keeps its scope
1
const memoCallback = useCallack(callback, optionalArgumentList);
Copied!
Where:
  1. 1.
    memoCallback : Return memorized by useCallback.
Copy link
Edit on GitHub