useLocation

tcmts.react.useLocation · #l66ngux6 · term · runs in the browser

uses tcmts.react.router, which uses tcmts.react.createRouter, which uses IntersectionObserver

Where the page is; the component re-renders when it changes. While the server renders the first paint, the page's URL. Under a base, path is within it: / is the base.

import { router } from "#codebase/tcmts/react";
import type { Where } from "#codebase/tcmts/react";

export const useLocation = (): Where => router.useLocation()

uses

used by