First time using react and don't understand what's the problem here. Any help would be appreciated. I have imported the files correctly still not able to solve this error:
Property 'name' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Product> & Readonly<{}>'
import { Component } from "react";
import Product from "./product";
export default class Shopping extends Component {
state = {
products: [
{
id: 1,
name: "Laptop",
price: "8000",
photo: "https://picsum.photos/id/1010/60",
quantity: 4,
},
{
id: 2,
name: "HeadPhone",
price: "9000",
photo: "https://picsum.photos/id/1011/60",
quantity: 7,
},
],
};
render() {
return (
<div>
<h4>Shopping Cart</h4>
<div>
{this.state.products.map((prod) => {
return <Product key={prod.id} name={prod.name} />; // this is where I am getting the error
})}
</div>
</div>
);
}
}