chore(docs): Updated API Reference (#6041)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a9b4214503
commit
bc58bc8f47
@@ -1,22 +1,22 @@
|
||||
import React from "react"
|
||||
import { useProducts } from "medusa-react"
|
||||
|
||||
function Product () {
|
||||
const { products, isLoading } = useProducts()
|
||||
|
||||
return (
|
||||
<div>
|
||||
{isLoading && <span>Loading...</span>}
|
||||
{products && !products.length && <span>No Products</span>}
|
||||
{products && products.length > 0 && (
|
||||
<ul>
|
||||
{products.map((product) => (
|
||||
<li key={product.id}>{product.title}</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Products
|
||||
import React from "react"
|
||||
import { useProducts } from "medusa-react"
|
||||
|
||||
const Products = () => {
|
||||
const { products, isLoading } = useProducts()
|
||||
|
||||
return (
|
||||
<div>
|
||||
{isLoading && <span>Loading...</span>}
|
||||
{products && !products.length && <span>No Products</span>}
|
||||
{products && products.length > 0 && (
|
||||
<ul>
|
||||
{products.map((product) => (
|
||||
<li key={product.id}>{product.title}</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Products
|
||||
|
||||
Reference in New Issue
Block a user