From 58f54cd11988c18149f9d87bb56957cf9ec9714a Mon Sep 17 00:00:00 2001 From: Ken Jannette Date: Fri, 20 Apr 2018 16:42:34 -0400 Subject: [PATCH] Corrected setState call in SearchPage --- src/SearchPage.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/SearchPage.js b/src/SearchPage.js index 9c9c343..1024bf8 100644 --- a/src/SearchPage.js +++ b/src/SearchPage.js @@ -14,8 +14,8 @@ class SearchPage extends Component { onSearch = (query) => { if (query.length > 3) { search(query).then((results) => { + this.setState({ results }); }) - this.setState({ results }); } }; @@ -38,9 +38,7 @@ class SearchPage extends Component {
    - if (this.state.results) { - - this.state.results.map((result) => + this.state.results.map((result) => (
  1. @@ -62,8 +60,6 @@ class SearchPage extends Component {
  2. ) - } -