0
I recently read an article entitled You’re overusing useMemo: Rethinking Hooks memoization. In it, I saw something interesting that I hadn’t thought of before, using the useRef
to store object references instead of useMemo
.
I thought the useRef
should be used only to store references of DOM elements. So the questions I have are:
The
useRef
really is the most appropriate hook to keep objects reference?There is another use case for the
useRef
?How does the behavior of mutable references that are referenced in other Hooks look like
useEffect
anduseCallback
?
very broad your question ...
– novic