title: react ES6 component, variables in construct vs state variables
body: <p>What is the difference between to define variables in the construct, and use them in the template versus to define inside getInitialState() function?</p>
  
  <p>In ES6 I can forget use getInitialState() and move all on the construct?</p>
  
  <p>Example:</p>
  
  <pre><code>class TodoApp extends Component {  
  
    constructor() {
      super();
      this.test1 = 'hello this is a test';
      this.state = { // thanks to @Piotr Berebecki, 
                    // i know to define states variable
        test2:'this is state test'
      }
    }
    changeTest () {
      this.state.test2 = 'my new state test';
  
    }
    render() {
  
  
      return (
        &lt;div&gt;
          &lt;button onClick={this.changeTest}&gt;change&lt;/button&gt;
          Test:{this.test1}
          &lt;br/&gt;State Test:{this.test2}
        &lt;/div&gt;
       );
    }
  }
  
  
  ReactDOM.render(
    &lt;TodoApp /&gt;,
    document.getElementById('app')
  );
  </code></pre>