I am trying to understand the difference between useMemo and useCallback and this statement in the documentation "useCallback(fn, deps) is equivalent to useMemo(() => fn, deps)."
So in useMemo, I have to pass a function that returns a function? In useCallback, I simply return a function. I get useCallback, but I am not sure about useMemo and this function that returns a function (or do I have this all wrong). Reading the SO posts is not helping here quite yet.
If useMemo is calling a function that returns a function, when is the second function called in react?