Delete workloads/ecommerce/src/components/navigation/CategoryMenu.tsx
Build and Push Frontend / build (push) Canceled after 0s
Build and Push Frontend / build (push) Canceled after 0s
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import type { ReactNode } from "react";
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
|
||||
type CatalogRouteBoundaryProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fuerza el remontaje del árbol del catálogo cuando cambia:
|
||||
* - pathname
|
||||
* - category
|
||||
* - collection
|
||||
* - section
|
||||
* - búsqueda, orden u otros parámetros
|
||||
*
|
||||
* Esto evita que useState/useMemo conserven filtros de una navegación anterior.
|
||||
*/
|
||||
export default function CatalogRouteBoundary({
|
||||
children,
|
||||
}: CatalogRouteBoundaryProps) {
|
||||
const pathname = usePathname();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const navigationKey = `${pathname}?${searchParams.toString()}`;
|
||||
|
||||
return <div key={navigationKey}>{children}</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user