useMemo

useMemo is a React Hook that caches (memoizes) the result of an expensive calculation so it is only recomputed when its dependencies change. It helps avoid…