M
M
miliko mikoyan2019-03-17 00:24:16
React
miliko mikoyan, 2019-03-17 00:24:16

Difference between useCallback and useMemo?

I read the react manual and didn't understand when to use useCallback and useMemo?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-03-17
@miliko0022

The call useCallback(fn, deps)is equivalent . The difference is in the additional wrapper that you don't have to write when using useCallback if you want to return a memorized callback. useMemo(() => fn, deps)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question