From b1ecacb8eceb0f889c725fa8288665cb2d696580 Mon Sep 17 00:00:00 2001 From: Stanislav Date: Wed, 27 May 2020 17:35:44 -0700 Subject: [PATCH] Component container --- src/components/book-list/book-list.js | 33 +++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/components/book-list/book-list.js b/src/components/book-list/book-list.js index 7a494a2..95879e8 100644 --- a/src/components/book-list/book-list.js +++ b/src/components/book-list/book-list.js @@ -9,7 +9,22 @@ import { fetchBooks } from '../../actions'; import { compose } from '../../utils'; import './book-list.css'; -class BookList extends Component { +const BookList = ({ books }) => { + return ( + + ) +}; +class BookListContainer extends Component { componentDidMount() { this.props.fetchBooks(); @@ -23,19 +38,7 @@ class BookList extends Component { if (error) { return } - return ( - - ) + return } }; @@ -53,4 +56,4 @@ const mapDispatchToProps = (dispatch, ownProps) => { export default compose( withBookstoreService(), connect(mapStateToProps, mapDispatchToProps) -)(BookList); +)(BookListContainer);