const memoValue = useMemo(callback, optionalArgumentList);
Where :
memoValue
: Return memorized by useMemo.callback
: Function that is executed one or more times according tooptionalArgumentList
.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:
memoCallback
: Return memorized by useCallback.