useLocationReturns the current location object.
import { useLocation } from "@remix-run/react";
function SomeComponent() {
const location = useLocation();
// ...
}
location.hashThe hash of the current URL.
location.keyThe unique key of this location.
location.pathnameThe path of the current URL.
location.searchThe query string of the current URL.
location.stateThe state value of the location created by <Link state> or navigate.