Fixed bug in onResultSelect in app.js so new books will persist after page refresh
This commit is contained in:
@@ -35,11 +35,11 @@ class BooksApp extends React.Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
books: [...this.state.books, newBook]
|
books: [...this.state.books, newBook]
|
||||||
});
|
});
|
||||||
});
|
|
||||||
const newBooks = this.state.books
|
const newBooks = this.state.books
|
||||||
newBooks.forEach((book) => {
|
newBooks.forEach((book) => {
|
||||||
update(book, book.shelf)
|
update(book, book.shelf)
|
||||||
})
|
})
|
||||||
|
});
|
||||||
history.push('/');
|
history.push('/');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user