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

15 lines
269 B
TypeScript
Raw Normal View History

2024-06-07 20:17:03 +03:00
'use client';
import { useLocation } from 'react-router-dom';
function useQueryStrings() {
const search = useLocation().search;
function get(key: string) {
return new URLSearchParams(search).get(key);
}
return { get };
}
export default useQueryStrings;