We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81508ce commit 1ece213Copy full SHA for 1ece213
client/pages/products/[id].tsx
@@ -21,7 +21,7 @@ export default function ProductDetailsPage(): React.JSX.Element | null {
21
22
const [quantity, setQuantity] = useState<number>(INITIAL_ITEM_COUNT);
23
24
- const { data } = useProductByIdService(+id!);
+ const { data, isLoading } = useProductByIdService(+id!);
25
const { dispatch } = useContext(ShoppingCartContext);
26
27
const specifications = useMemo(() => ([
@@ -60,7 +60,7 @@ export default function ProductDetailsPage(): React.JSX.Element | null {
60
setQuantity(INITIAL_ITEM_COUNT);
61
}
62
63
- if (!data) {
+ if (!data || isLoading) {
64
return null;
65
66
0 commit comments