Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

useRenderedSettingsPathname.ts

7 lines385 Bytes

1import { useMatches } from "@tanstack/react-router";
2​
3// useLocation switches as soon as a navigation starts, while <Outlet> keeps the old page until
4// the next route's lazy chunk loads. Chrome that frames the page must follow the committed match.
5export function useRenderedSettingsPathname(): string {
6 return useMatches({ select: (matches) => matches.at(-1)?.pathname ?? "" });
7}