title: Why is getInitialState not being called for my React class?
body: <p>I'm using ES6 classes with Babel. I have a React component that looks like this:</p>
  
  <pre><code>import { Component } from 'react';
  
  export default class MyReactComponent extends Component {
    getInitialState() {
      return {
        foo: true,
        bar: 'no'
      };
    }
  
    render() {
      return (
        &lt;div className="theFoo"&gt;
          &lt;span&gt;{this.state.bar}&lt;/span&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>It doesn't look like <code>getInitialState</code> is being called, because I'm getting this error: <code>Cannot read property 'bar' of null</code>.</p>