diff --git a/src/App.js b/src/App.js index 745a9b2..286851a 100755 --- a/src/App.js +++ b/src/App.js @@ -11,7 +11,8 @@ class BooksApp extends React.Component { constructor() { super(); this.state = { - books: [] + books: [], + results: [] } }; @@ -35,10 +36,11 @@ class BooksApp extends React.Component { onSearch = (query) => { if (query.length > 3) { - search(query).then((result) => - console.log(result)) - } + search(query).then((results) => { + this.setState({ results }) + }) } +} render() { return ( @@ -55,6 +57,7 @@ class BooksApp extends React.Component { ( )}/> diff --git a/src/SearchPage.js b/src/SearchPage.js index 5ca64c4..1e26054 100644 --- a/src/SearchPage.js +++ b/src/SearchPage.js @@ -6,6 +6,8 @@ class SearchPage extends Component { render() { const onSearch = this.props.onSearch + const results = this.props.results + console.log("RESULT ", results[0]) return (
@@ -20,7 +22,10 @@ class SearchPage extends Component {
-
    +
      + + +
    )