Initializing react component state
<p>I came across some react code that defined a component state inside a class like follows:</p>

<pre><code>// Snippet 1
class Sample extends React.Component {
    state = {
        count: 0
    }
}
</code></pre>

<p>The way I've learnt React was to declare the state inside the constructor of a class:</p>

<pre><code>// Snippet 2
class Sample extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            count: 0
        };
    }
}
</code></pre>

<p>The only difference I can think of is that initializing the state in the constructor would guarantee the state gets initialized properly in the component life cycle. </p>

<p>What are the differences between the above two code snippets? In snippet 1, is it safe to assume that the state be properly set when the class is initialized?</p>