Currently, I am going through an interesting article that includes the following type definition:
export type CartItem = {
productId: Product['id'];
quantity: number;
total: number;
};
From what I gather, it seems like the productId
property must match the type assigned to product['id']
. Just in case, here is how it's defined:
export type Product = {
id: ID;
title: string;
description: string;
price: number;
};