title: How do I pass a const variable to a component as a prop in React?
body: <p>I am trying to pass the wantedAirline variable into the AirlineSection Component but I keep getting the error <code>TypeError: Cannot read property 'wantedAirline' of undefined</code> from inside the AirlineSection component.</p>
  <pre><code>render() {
      const wantedAirline = this.state.wantedAirline.filter(p =&gt;
        p.name.includes(this.state.searchTerm)
      )
      return (
        &lt;div&gt;
          &lt;header&gt;Pokemon Searcher&lt;/header&gt;
  
          &lt;AirlineSection 
          wantedAirline = {wantedAirline}
          airlines = {this.state.airlines}
          handleDelete={this.handleDelete}/&gt;
  
        &lt;/div&gt;
      )
    }
  </code></pre>
  <p>The AirlineSection Component looks like this:</p>
  <pre><code>function AirlineSection(props){
      console.log(props, 'airline section props');
      return(
          &lt;div&gt;
              &lt;h2&gt;Airlines&lt;/h2&gt;
              {props.airlines.map(airline =&gt; &lt;AirlineCard key={airline.id}  wantedAirline={this.wantedAirline} airline={airline} handleDelete={props.handleDelete}/&gt;)}
          &lt;/div&gt;
      )
  }
  </code></pre>