title: React: Prevent auto-refresh when a class's state change
body: <p>I am new to react.</p>
  <p>I have a class-based component. Let's say the code inside is:</p>
  <pre><code>state = {message: &quot;Hello&quot;}
  
  render(){
  &lt;div&gt;  
     &lt;p&gt;this.state.message&lt;/p&gt;
     &lt;button onclick={() =&gt;this.setState({message: &quot;World&quot;})}&gt;click here&lt;/button&gt;
  &lt;/div&gt;
  }
  </code></pre>
  <p>When I click the button, display on the screen change from &quot;Hello&quot; to &quot;World&quot;, but then the page refresh and the display turns back to the default &quot;Hello&quot; again.</p>
  <p>How should I prevent the automatic refresh? I want my page to display &quot;World&quot; after I press the button.</p>
  <p>I really appreciate your help.</p>