title: How to start search only when user stops typing?
body: <p>I need to perform a Search when user stops typing.I know I am supposed to use <strong>setTimeout()</strong> . But with <strong>Reactjs I cant find how it works.</strong> Can someone please tell me how to invoke a method (that will handle Search) when the user stops typing for a few seconds (suppose 5).I cant figure out where to write the code to check that the user has stopped typing.</p>
  
  <pre><code>import React, {Component, PropTypes} from 'react';
  
  export default class SearchBox extends Component {
  
      state={
        name:" ",
      }
  
      changeName = (event) =&gt; {
          this.setState({name: event.target.value}); 
      }
  
      sendToParent = () =&gt; {
          this.props.searching(this.state.name);
      }
  
      render() {
          return (
              &lt;div&gt;
                   &lt;input type="text"  placeholder='Enter name you wish to Search.'  onChange={this.changeName} /&gt;
  
              &lt;/div&gt;
          );
      }
  }   
  </code></pre>
  
  <p>I want to invoke the sendToParent method when the user stops typing.</p>