diff --git a/web/hooks/use-tab-searchparams.ts b/web/hooks/use-tab-searchparams.ts index 6a665bca5a..3009923ea7 100644 --- a/web/hooks/use-tab-searchparams.ts +++ b/web/hooks/use-tab-searchparams.ts @@ -1,4 +1,4 @@ -import { usePathname, useRouter, useSearchParams } from 'next/navigation' +import { usePathname, useSearchParams } from 'next/navigation' import { useState } from 'react' type UseTabSearchParamsOptions = { @@ -24,7 +24,6 @@ export const useTabSearchParams = ({ searchParamName = 'category', disableSearchParams = false, }: UseTabSearchParamsOptions) => { - const router = useRouter() const pathName = usePathname() const searchParams = useSearchParams() const [activeTab, setTab] = useState( @@ -37,7 +36,7 @@ export const useTabSearchParams = ({ setTab(newActiveTab) if (disableSearchParams) return - router[routingBehavior](`${pathName}?${searchParamName}=${newActiveTab}`) + history[`${routingBehavior}State`](null, '', `${pathName}?${searchParamName}=${newActiveTab}`) } return [activeTab, setActiveTab] as const