loading...

Update index page to use ProductList component

notrab profile image Jamie Barton ・1 min read

Let's use the newly created ProductList component on our homepage.

Inside src/pages/index.js, import the component:

import ProductList from "../components/ProductList";

Next replace the following:

<pre>{JSON.stringify(products, null, 2)}</pre>

With our new ProductList component, and pass along products as a prop.

<ProductList products={allChecProduct.nodes} />

Discussion

pic
Editor guide