Don-Stevenson / paul-don-react

0 stars 0 forks source link

display results in jsx only when there are search results results #7

Open Don-Stevenson opened 2 years ago

Don-Stevenson commented 2 years ago

use conditional logic in the jsx code

eg

<div className="App">
  <header>
    <h1>Movie Database</h1>
  </header>
  <main>
    {
      //handle the search results, opening the pop up and closing the popup upon selection
    }
    <Search handleInput={handleInput} search={search} />

    <Results results={state.results} openPopup={openPopup} />
    {typeof state.selected.Title !== "undefined" ? (
      <Popup selected={state.selected} closePopup={closePopup} />
    ) : (
      false
    )}
  </main>
</div>