How does useCallback handle functions defined outside the component's scope?
UseCallback memoizes functions defined outside the component's scope only if explicitly specified, ensuring that they are memoized properly to prevent unnecessary re-renders.