title: Reactjs Concat with prev state
body: <p>I have this simple react code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class App extends React.Component {
    constructor() {
      super();
      this.state = {
        textarea: 'Hello World! \n \nTry to press Shift enter after Hello \n \nShould be like this \nHello \nWorld! '
      };
    }
    onChange = (e) =&gt; {
      this.setState({ textarea: e.target.value })
    }
    handlePress = e =&gt; {
      if (e.keyCode === 13 &amp;&amp; e.shiftKey) {
        e.preventDefault();
        this.setState(prevState =&gt; ({ textarea: prevState.textarea.concat('\n why here') }))
      } else if (e.keyCode === 13) {
        e.preventDefault();
  
      }
    }
    render() {
      return (
        &lt;div&gt;
  
          &lt;textarea style={{ height: 200, width: 200 }} value={this.state.textarea} onKeyDown={this.handlePress} onChange={this.onChange} /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById('code'));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"&gt;&lt;/script&gt;
  &lt;div id='code'&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/qsyIB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qsyIB.png" alt="enter image description here"></a></p>
  
  <p><strong>Should Be like this</strong></p>
  
  <p><a href="https://i.stack.imgur.com/mafF0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mafF0.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me please or just guide me to correct way I'm stack in this problem even I don't know how to explain it to make a research</p>