title: How to fill dropdown with JSON data in React?
body: <p>I try to fill in a dropdown with data from the JSON format but for now the dropdown is empty (no results found...)</p>
  
  <p>I certainly have a mistake and I can not understand where I'm confusing.</p>
  
  <p>I will attach a screen of my API.</p>
  
  <p>I want to get Station and NameStation..</p>
  
  <p><a href="https://i.stack.imgur.com/jyrcm.png" rel="nofollow noreferrer">API for Stations</a></p>
  
  <p>My code:</p>
  
  <pre><code>import React, { Component } from 'react';
  import Select from 'react-select';
  import 'react-select/dist/react-select.css';
  
  function parseStations(stations){
    return stations.map((station) =&gt; {
      return { label: station.NameStation, value: station.Station };
    });
  }
  
  export default class Weather extends Component {
    constructor(props) {
      super(props);
      this.state = {
        options: [
          { value: true, label: 'Yes' },
          { value: false, label: 'No' }
        ], stations: [
  
        ],
        value: null
      }
      this.onChange = this.onChange.bind(this);
    }
    onChange(event) {
      this.setState({ value: event.value });
      console.log('Boolean Select value changed to', event.value);
    }
  
    componentDidMount() {
      this.getStations();
    }
  
    getStations() {
      fetch('http://localhost:56348/api/stations', {
        data: 'Station',
        data: 'NameStation',
        method: "GET"
      }).then(res =&gt; res.json())
        .then(res =&gt; this.setState({ stations: parseStations(res.stations) }))
        //.then(res =&gt; this.setState({ stations: res.stations }))
        //.catch(e =&gt; )
    }
  
    render() {
      return (
        &lt;div className="MasterSection"&gt;
          &lt;div className="wrapper"&gt;
            &lt;div className="section"&gt;Изберете № на станция&lt;/div&gt;
            &lt;Select
              onChange={this.onChange}
              //options={this.state.options}
              options={this.state.stations}
              value={this.state.value}
              clearable={false}
            /&gt;
          &lt;/div&gt;
          &lt;div class="section"&gt;
            &lt;input type="text" class="form-control" placeholder="Брой дни назад" aria-label="Username" aria-describedby="basic-addon1"&gt;&lt;/input&gt;
          &lt;/div&gt;
          &lt;div class="section"&gt;
            &lt;button type="button" class="btn btn-outline-dark"&gt;Покажи&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>