title: How not to refresh the page after onClick
body: <p>I have small class in react, i want to display the result on the screen after i click on the button, but before the display happens, the page reload.</p>
  
  <p>how do i do it?</p>
  
  <p>what am I missing?</p>
  
  <pre><code>import React, {Component} from 'react';
  
  class InputFieldWithButton extends Component{
      constructor(props){
      super();
      this.state = {
        message: ''
      };
    }
  
    handleChange(e){
      this.setState({
        message: e.target.value
      });
    }
  
    doSomething(e){
      return(
        &lt;h1&gt;{this.state.message}&lt;/h1&gt;
      )
    }
  
    render(){
      return (
        &lt;div&gt;
          &lt;form &gt;
          &lt;input type="text" placeholder="enter some text!" value=
        {this.state.message}
          onChange={this.handleChange.bind(this)}/&gt;
          &lt;button onClick={this.doSomething.bind(this)}&gt;Click me&lt;/button&gt;
            &lt;/form&gt;             
        &lt;/div&gt;
      )
    }
  }
  
  export default InputFieldWithButton;
  </code></pre>