Skip to content

Instantly share code, notes, and snippets.

@techomoro
Created Jan 16, 2021
Embed
What would you like to do?
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