-
-
Save techomoro/dcbfcada7bf732a6ec66f1396294d266 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext } from "react"; | |
import AppContext from "../AppContext"; | |
function Favorites() { | |
const value = useContext(AppContext); | |
return ( | |
<div className="books"> | |
{value.state.favorites.map((book, index) => { | |
return ( | |
<div className="book" key={index}> | |
<h2 className="title">{book.title}</h2> | |
<p className="description">{book.description}</p> | |
<h6 className="author">{book.author}</h6> | |
</div> | |
); | |
})} | |
</div> | |
); | |
} | |
export default Favorites; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment