Content
@
https://opensea.io/collection/dev-21
0 reply
0 recast
2 reactions
Glib
@sushev
What is useMemo? useMemo is a built-in hook that memoizes a computed value. It takes a function and a list of dependencies, then recomputes the value only when one of the dependencies changes. If the dependencies haven’t changed between renders, React returns the memoized (cached) value. Syntax javascript Копировать Редактировать const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]); Callback function: The first parameter is a function that returns the computed value. Dependency array: The second parameter is an array of dependencies. The computation is rerun only if one or more of these dependencies have changed since the last render. https://react.dev/reference/react/useMemo
0 reply
0 recast
0 reaction