Fixed bug in onResultSelect in app.js so new books will persist after page refresh

This commit is contained in:
Ken Jannette
2018-04-20 18:54:14 -04:00
parent 37b3c47699
commit b6b43e6057

View File

@@ -35,11 +35,11 @@ class BooksApp extends React.Component {
this.setState({
books: [...this.state.books, newBook]
});
const newBooks = this.state.books
newBooks.forEach((book) => {
update(book, book.shelf)
})
});
const newBooks = this.state.books
newBooks.forEach((book) => {
update(book, book.shelf)
})
history.push('/');
};