* lots of changes to handle new routing * handle some redirect cases * remove unused stuff Co-authored-by: Nacho Iacovino <[email protected]>
11 lines
266 B
TypeScript
11 lines
266 B
TypeScript
import { useRouter } from "next/router";
|
|
import { getSingleQueryValue } from "utils/router";
|
|
|
|
export function useSingleQueryParam<T extends string>(
|
|
key: string,
|
|
): T | undefined {
|
|
const { query } = useRouter();
|
|
|
|
return getSingleQueryValue(query, key) as T;
|
|
}
|