title: how to set value in react-select
body: <p>how to set value by id in react-select
  For example, I want to select the label value according to the value of the ID.
  id = "2" result = "Summer"</p>
  
  <pre><code>class MyComponent extends React.Component {
    constructor(props) {
      super(props);
  
      this.state = { selectedOption: "" };
    }
  
    options = [
      { id: "1", value: "Spring", label: "Spring" },
      { id: "2", value: "Summer", label: "Summer" },
      { id: "3", value: "Autumn", label: "Autumn" },
      { id: "4", value: "Winter", label: "Winter" }
    ];
  
    handleChange = selectedOption =&gt; {
      this.setState({ selectedOption });
    };
  
    render() {
      return (
        &lt;Select
          value={this.state.selectedOption}
          onChange={this.handleChange}
          options={this.options}
        /&gt;
      );
    }
  }
  </code></pre>
  
  <p>Here you can see my <a href="https://codesandbox.io/s/react-select-basic-pkj1i?file=/src/index.js" rel="nofollow noreferrer">CodeSandbox</a>.
  Thank you in advance for your help and guidance</p>