Careeroza
useMemo vs useCallback
Difference
| useMemo | useCallback | |
|---|---|---|
| Caches | the result of a function | the function itself |
| Returns | a value | a function |
| Typical use | expensive calculation, stable object | event handler passed to a memo child |
| useMemo | useCallback | |
|---|---|---|
| Caches | the result of a function | the function itself |
| Returns | a value | a function |
| Typical use | expensive calculation, stable object | event handler passed to a memo child |