update resolve route

This commit is contained in:
Rami Bitar
2026-06-06 11:34:08 -04:00
parent 0625487af0
commit b64c633549
7 changed files with 72 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import { useRouteHandle } from "@/lib/resolve-route";
import { useRouteSegment } from "@/hooks/use-route-segment";
import type { ShopifyProduct } from "@reacteditor/field-shopify";
import { useProduct } from "@/hooks/use-shopify-products";
import { useShopifyCart } from "@/hooks/use-shopify-cart";
@@ -14,7 +14,7 @@ export type ProductDetailsProps = {
};
export function ProductDetailsView({ product: selected }: ProductDetailsProps) {
const routeHandle = useRouteHandle();
const routeHandle = useRouteSegment();
const handle = selected?.handle ?? routeHandle ?? null;
const { product, loading } = useProduct(handle);
const cart = useShopifyCart();