useLocation
Edit this pageRetrieves reactive location object useful for getting things like pathname
const location = useLocation();
const pathname = createMemo(() => parsePath(location.pathname));| attribute | type | description |
|---|---|---|
pathname | string | The pathname part of the URL, without the query string. |
search | string | The query string part of the URL. |
hash | string | The hash part of the URL, including the #. |
state | any | Custom state passed from useNavigate |
query | string | Returns a store-like object containing all the query parameters of the URL. |