I'd like to know how I'm exporting my object incorrectly? In my view, I'm seeing this error: ./src/context.js
Attempted import error: 'detailProduct' is not exported from './data'.
In the console I indeed see the objects being populated correctly but for some reason it won't render my view because of the aforementioned error. What am I doing wrong?
export const storeProducts = [
{
id: 1,
title: "Crusk Beanie (black)",
img: "img/CruskipBlackBeanie.png",
price: 1,
company: "Cruskip",
info:
"Winter's right around the corner, get your beanie today!",
inCart: false,
count: 0,
total: 0
},
{
id: 3,
title: "Cruskip Short Sleeve T-shirt",
img: "img/CruskipWhiteShortSleeve.jpg",
price: 8,
company: "Cruskip",
info:
"Exclusive Cruskip white t-shirts!",
inCart: false,
count: 0,
total: 0
},
];
let detailProduct = {};
storeProducts.forEach((arrayItem) => {
detailProduct = {
id: arrayItem.id,
title: arrayItem.title,
img: arrayItem.img,
price: arrayItem.price,
company: arrayItem.company,
info: arrayItem.info,
inCart: arrayItem.inCart,
count: arrayItem.count,
total: arrayItem.total
};
console.log(arrayItem);
});
export default detailProduct;