Lead says async func in useCallback is incorrect, use useMemo instead, WTF?

  • You can memoize any function with `useCallback`, sync or async. All it's doing is watching when the deps array changes, and saving whatever function reference was passed in at that time.

    (Note that this does not mean that the function itself is memoized in terms of "cache the result and check the arguments to see if we know this answer already".)

  • Just try it out. The programming language of your choice sure offers information and tools.