From b6b43e6057b145283a88a29c85d18d6d4cb3c8af Mon Sep 17 00:00:00 2001 From: Ken Jannette Date: Fri, 20 Apr 2018 18:54:14 -0400 Subject: [PATCH] Fixed bug in onResultSelect in app.js so new books will persist after page refresh --- src/App.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index b3fd2dd..2e3b738 100755 --- a/src/App.js +++ b/src/App.js @@ -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('/'); };