Can easily create a brother or a sister
This commit is contained in:
11
geneit_app/src/hooks/useQuery.tsx
Normal file
11
geneit_app/src/hooks/useQuery.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
// A custom hook that builds on useLocation to parse
|
||||
|
||||
import React from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
// the query string for you.
|
||||
export function useQuery(): URLSearchParams {
|
||||
const { search } = useLocation();
|
||||
|
||||
return React.useMemo(() => new URLSearchParams(search), [search]);
|
||||
}
|
Reference in New Issue
Block a user