How does useMemo handle values defined outside the component's scope?
useMemo caches the value returned by its calculation function. Values defined outside the component, such as module constants or imports, are usually already stable; React may compare them if they are included as dependencies, but useMemo does not memoize those external values themselves.