title: Input box in react to show suggestions in reactjs
body: <p>How to make an input box which will give suggestion with small delay not on every character input fast. I don't want to hit suggestion api on every char input.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Input extends React.Component {
  constructor (props){
  super(props);
  this.state = {
    inputVal:'',
    suggestion : []
  }
  }
  
  handleChange = ({target:{value}})=&gt;{
    fetch('https://api.github.com/search/users?q='+value, (res)=&gt;{
    this.setState({suggestions:res.items});
    });  
  }
  
  
    render(){
      &lt;input onChange={this.handleChange} value {this.state.inputVal} /&gt;
      &lt;ul id="suggestions"&gt;
      this.state.suggestions.map(sugg=&gt;{
        return (
        &lt;li&gt;{sugg.login}&lt;/li&gt;
        )
      })
      &lt;/ul&gt;
    }
  }
  
  ReactDOM.render(&lt;Input /&gt;, document.getElementById('container'));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"&gt;&lt;/script&gt;
  &lt;div id='container'&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>