Why is this not scoped in React form onSubmit function?
<p>In my React component I have a form with onSubmit function</p>

<p><code>&lt;form className="form-horizontal" name="taskForm" onSubmit={this.submitTask}&gt;</code></p>

<pre><code>submitTask(e) {

  e.preventDefault();
  console.log(this.props);  // undefined
  console.log(this) // window object
}
</code></pre>

<p>For some reason <code>this.props</code> is not in scope when I use form onSubmit. When I <code>console.log(this.props)</code> in the constructor, props logs out normally. </p>

<p>When I <code>console.log(this)</code> it is the window object. How do I get the scope of the react component?</p>