title: React.js onclick event: Cannot read property 'props' of undefined
body: <p>I am a beginner in the react framework, so my question may appear basic to many of you. But believe me I've been stuck on this part.
  I am trying to get the text box value on button click and send the value to other function as a prop.
  I'm able to extract the value of textbox field but on the click event, i get an error 'Cannot read property 'props' of undefined'.</p>
  
  <p>here are the important points:-</p>
  
  <ol>
  <li>termchange() is used for extracting the input text value.</li>
  <li>handleclick is used for extracting textbox value onclick event.</li>
  <li>oncitychange is a function to which I've to send the value of textbox 
  (oncitychange() function is inside different component).</li>
  </ol>
  
  <p>Thank you in advance.</p>
  
  <p>here's my code:-</p>
  
  <pre><code>import React,{ Component } from 'react';
  import ReactDom from 'react-dom';
  class SearchBar extends Component {
    constructor(props){
      super(props);
      this.state = {
        cityname:''
      }
    }
  
    render(){
      return(
        &lt;div&gt;
          &lt;span&gt;Enter the city: &lt;/span&gt;
          &lt;input type="text" id="txtbox" value={this.state.cityname} 
            onChange={event=&gt;this.termchange(event.target.value)} /&gt;
          &lt;input type="submit" onClick={this.handleclick} /&gt;
        &lt;/div&gt;
      );
    }
  
    termchange(cityname){
      this.setState({cityname});
    }
  
    handleclick(){
      this.props.oncitychange(cityname);
    }
  }
  
  export default SearchBar;
  </code></pre>