When to useMemo and useCallback
Briefly

Every line of code executed has a cost. React.useCallback can introduce more work like defining functions, arrays, and calling itself, possibly not improving performance.
In both cases, JavaScript allocates memory for function definitions on every render. React.useCallback can lead to more function definition allocations, impacting performance.
Read at Kentcdodds
[
add
]
[
|
|
]