I have this long-winded component which is passing many props. Is there a dryer way of passing this component to child?
Thanks.
let products;
if (!this.state.loading) {
products = this.state.products.map(product => (
<Product
description={product.description}
title={product.title}
originalRetailPrice={product.original_retail_price.formatted_value}
retailPrice={product.retail_price.formatted_value}
priceValue={product.retail_price.value}
discounted={product.discount}
imageURL={product.cover_image_url}
key={product.uuid}
uuid={product.uuid}
onClick={this.addToBagHandler}
/>
));
}
These are properties returned from an api call.
productor something similar. Looks like you're already getting an object like that.