Create a new component ProductsList
and save in its state the given array of products. Display all the products (their name and price, not paying attention to the inStock
property):
// ...
state = {
products: [
{
_id: '34rg',
name: 'iron hat',
price: 11.99,
inStock: false
},
{
_id: '36gu',
name: 'iron tshirt',
price: 19.99,
inStock: true
},
{
_id: '97ux',
name: 'iron coffee mug',
price: 7.0,
inStock: true
}
]
};