I want to access the URL parameters with useLocation()
in a routeLoader$()
:
export const useRouteLoader = routeLoader$(
(requestEvent: RequestEvent) => {
const loc = useLocation();
console.log(loc.params);
//Other code
}
);
But it does not work. I want to log the URL params to the console. How do i do that?