mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
10 lines
240 B
TypeScript
10 lines
240 B
TypeScript
|
export const useRequiredQueryParam = (key: string) => {
|
||
|
const value = new URLSearchParams(window.location.search).get(key);
|
||
|
|
||
|
if (!value) {
|
||
|
throw new Error(`Missing required query param: ${key}`);
|
||
|
}
|
||
|
|
||
|
return value;
|
||
|
};
|