react-dom.development.js:14887 Uncaught Error: Objects are not valid as a React child (found: object with keys {name, img, author, price}). If you meant to render a collection of children, use an array instead.
import React from "react";
const books = [
{
name: "The Psychology of Money",
img: "https://m.media-amazon.com/images/I/71g2ednj0JL._AC_UY218_.jpg",
author: "morgan hussel",
price: "239",
},
{
name: "The Psychology of Money",
img: "https://m.media-amazon.com/images/I/71g2ednj0JL._AC_UY218_.jpg",
author: "morgan hussel",
price: "239",
},
];
function BookList() {
return <div>
<h1>{books.map((book) => {return book})}</h1>
</div>;
};
export default BookList;