Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/dashboard/src/hooks/use-query-params.ts
2500 views
1
/**
2
* Copyright (c) 2023 Gitpod GmbH. All rights reserved.
3
* Licensed under the GNU Affero General Public License (AGPL).
4
* See License.AGPL.txt in the project root for license information.
5
*/
6
7
import { useMemo } from "react";
8
import { useLocation } from "react-router";
9
10
export const useQueryParams = () => {
11
const { search } = useLocation();
12
13
return useMemo(() => new URLSearchParams(search), [search]);
14
};
15
16