A unified hook for reading router state: current (active) and in-flight
(pending) locations, search params, params, matches, and navigation type.
import { unstable_useRouterState as useRouterState } from "react-router";
let { active, pending } = useRouterState();
active.params; // params from the leaf match
pending?.location.pathname; // populated during in-flight navigations
function useRouterState(): unstable_RouterState
The current router state with active and pending variants