Portal/rsconcept/frontend/src/hooks/use-query-strings.ts

13 lines
239 B
TypeScript
Raw Normal View History

2024-06-07 20:17:03 +03:00
'use client';
2024-11-25 19:52:57 +03:00
import { useLocation } from 'react-router';
2024-06-07 20:17:03 +03:00
2025-02-19 23:29:45 +03:00
export function useQueryStrings() {
2024-06-07 20:17:03 +03:00
const search = useLocation().search;
function get(key: string) {
return new URLSearchParams(search).get(key);
}
return { get };
}