UseMemo memoizes values defined outside the component's scope only if explicitly specified, ensuring that they are memoized properly to prevent unnecessary re-renders.