-
With import { Outlet, useLocation } from 'react-router-dom';
function RouteWrapper() {
const location = useLocation();
return (
<>
<Analytics pathname={location.pathname} />
<Outlet />
</>
);
} How can I achieve the same with this package? import { Outlet, RootRoute } from '@tanstack/react-router'
function RouteWrapper() {
const location = null // ???
return (
<>
<Analytics pathname={location.pathname} />
<Outlet />
</>
)
}
export const Route = new RootRoute({
component: RouteWrapper,
}) |
Beta Was this translation helpful? Give feedback.
Answered by
borstessi
Jan 24, 2024
Replies: 1 comment 4 replies
-
i think i found the solution. you can use the useRouterState Hook:
it is reactive and will change on navigation |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
mrlubos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mrlubos
i think i found the solution.
you can use the useRouterState Hook:
it is reactive and will change on navigation