Co-authored-by: Bandhan Majumder <133476557+bandhan-majumder@users.noreply.github.com>
15 lines
324 B
TypeScript
15 lines
324 B
TypeScript
const getQueryParam = (paramName: string) => {
|
|
if (typeof window !== "undefined") {
|
|
const currentUrl = new URL(window.location.href);
|
|
const searchParams = currentUrl.searchParams;
|
|
|
|
const parameter = searchParams.get(paramName);
|
|
|
|
return parameter;
|
|
}
|
|
|
|
return undefined;
|
|
};
|
|
|
|
export default getQueryParam;
|