Question 3 of 10Pro Only
What is useMemo and what problem does it solve? Give an example where useMemo actually improves performance.
Sample answer preview
useMemo is a hook that memoizes the result of an expensive calculation. It only recalculates the value when its dependencies change, avoiding unnecessary recalculations on every render. The syntax is as follows.
useMemomemoizationexpensive calculationdependenciesperformanceoptimization