docs: fixes to implement cart docs (#4645)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2023-07-31 17:30:58 +03:00
1 parent da903fd798
commit 14fe1f1f69
1 file changed
+7 -3
@@ -214,12 +214,16 @@ if (id) {
<TabItem value="medusa-react" label="Medusa React" default> <TabItem value="medusa-react" label="Medusa React" default>
```tsx ```tsx
import { useGetCart } from "medusa-react" import { useCart } from "medusa-react"
const Cart = () => { const Cart = () => {
const { cart, isLoading } = useGetCart(cart_id) const { cart } = useCart()
// ... return (
<div>
Items in Cart: {cart?.items.length || 0}
</div>
)
} }
export default Cart export default Cart