Portal/rsconcept/frontend/src/hooks/useQueryStrings.ts

15 lines
265 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
function useQueryStrings() {
const search = useLocation().search;
function get(key: string) {
return new URLSearchParams(search).get(key);
}
return { get };
}
export default useQueryStrings;