useMemo and useCallback
const memoValue = useMemo(callback, optionalArgumentList);
Where :
- 1.
memoValue
: Return memorized by useMemo. - 2.
callback
: Function that is executed one or more times according tooptionalArgumentList
. - 3.
optionalArgumentList
: Array of arguments that controls the execution ofcallback
, if an argument ofoptionalArgumentList
changes it will trigger thatcallback
is executed again.
Hook that allows you to memorize a callback so that it keeps its scope
const memoCallback = useCallack(callback, optionalArgumentList);
Where:
- 1.
memoCallback
: Return memorized by useCallback.
Last modified 10mo ago