diff --git a/web/hooks/use-defined-search-params.ts b/web/hooks/use-defined-search-params.ts index dd47c03bfe..f115e8058e 100644 --- a/web/hooks/use-defined-search-params.ts +++ b/web/hooks/use-defined-search-params.ts @@ -1,12 +1,12 @@ import { useSearchParams } from 'next/navigation' import { useCallback } from 'react' -import { URLSearchParams } from 'url' export const useDefinedSearchParams = () => { // Note: useSearchParams() must be used inside a component if page is SSR const searchParams = useSearchParams()! const createQueryString = useCallback( (name: string, value: string) => { - const params = new URLSearchParams(searchParams as URLSearchParams) + // Note: don't cast searchParams as URLSearchParams or you'll break this instantiation + const params = new URLSearchParams(searchParams as any) params.set(name, value) return params.toString()