diff --git a/README.md b/README.md index c3fa3f6b5..9f1a06883 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ A Next.js 13 and App Router-ready ecommerce template featuring: - Checkout and payments with Shopify - Automatic light/dark mode based on system settings -> Note: Looking for Next.js Commerce v1? View the [code](https://github.com/vercel/commerce/tree/v1), [demo](https://commerce-v1.vercel.store), and [release notes](https://github.com/vercel/commerce/releases/tag/v1) +
+ +> Note: Looking for Next.js Commerce v1? View the [code](https://github.com/vercel/commerce/tree/v1), [demo](https://commerce-v1.vercel.store), and [release notes](https://github.com/vercel/commerce/releases/tag/v1). ## Providers diff --git a/components/layout/search/filter/item.tsx b/components/layout/search/filter/item.tsx index d9298582c..38777ea48 100644 --- a/components/layout/search/filter/item.tsx +++ b/components/layout/search/filter/item.tsx @@ -5,22 +5,17 @@ import { SortFilterItem } from 'lib/constants'; import { createUrl } from 'lib/utils'; import Link from 'next/link'; import { usePathname, useSearchParams } from 'next/navigation'; -import { useEffect, useState } from 'react'; import type { ListItem, PathFilterItem } from '.'; function PathFilterItem({ item }: { item: PathFilterItem }) { const pathname = usePathname(); const searchParams = useSearchParams(); - const [active, setActive] = useState(pathname === item.path); + const active = pathname === item.path; const newParams = new URLSearchParams(searchParams.toString()); const DynamicTag = active ? 'p' : Link; newParams.delete('q'); - useEffect(() => { - setActive(pathname === item.path); - }, [pathname, item.path]); - return (