title: How to edit an element's text with React.js?
body: <p>i wanna edit my <code>p</code> element's text when i press edit <code>button</code>.</p>
  
  <p>When i click edit <code>button</code>, i display a <code>textarea</code> and get keyed text with alert but can't put that text to my <code>p</code> element.</p>
  
  <p>What is the simple way to do it with React.js ?</p>
  
  <p><a href="https://jsfiddle.net/mxmx13hp/" rel="nofollow noreferrer"><strong>JSFIDDLE</strong></a></p>
  
  <p>When i press edit button, editing state changing and textarea shows up.The code below.</p>
  
  <pre><code>renderNormal: function() {
      return (
        &lt;div&gt;
          &lt;p&gt;Edit me&lt;/p&gt;
          &lt;button onClick={this.edit}&gt;Edit&lt;/button&gt;
      &lt;/div&gt;
      )
    },
    renderForm: function() {
      return (
        &lt;div&gt;
           &lt;textarea ref="newText" defaultValue="Edit me"&gt;&lt;/textarea&gt;
          &lt;button onClick={this.save}&gt;Save&lt;/button&gt;
      &lt;/div&gt;
      )
    },
    render: function() {
      if (this.state.editing) {
        return this.renderForm()
      } else {
        return this.renderNormal()
      }
    }
  </code></pre>