The 'useLocation' hook is used to access the current location object. This object contains information about the current URL, including the pathname, search string, and hash.