title: React event type in Typescript
body: <p>I can't build my React/Typescript app when I use <code>MouseEvent</code> type in my event handler:</p>
  
  <pre><code>private ButtonClickHandler(event: MouseEvent): void
  {
      ...
  }
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>error TS2322: Type '{ onClick: (event: MouseEvent) =&gt; void; children: string; }' is not assignable to type 'DetailedHTMLProps&lt;ButtonHTMLAttributes&lt;HTMLButtonElement&gt;, HTMLButtonElement&gt;'.
    Type '{ onClick: (event: MouseEvent) =&gt; void; children: string; }' is not assignable to type 'ButtonHTMLAttributes&lt;HTMLButtonElement&gt;'.
      Types of property 'onClick' are incompatible.
        Type '(event: MouseEvent) =&gt; void' is not assignable to type 'EventHandler&lt;MouseEvent&lt;HTMLButtonElement&gt;&gt;'.
          Types of parameters 'event' and 'event' are incompatible.
            Type 'MouseEvent&lt;HTMLButtonElement&gt;' is not assignable to type 'MouseEvent'.
              Property 'fromElement' is missing in type 'MouseEvent&lt;HTMLButtonElement&gt;'.`
  </code></pre>
  
  <p>I also tried <code>MouseEvent&lt;HTMLButtonElement&gt;</code> but then I got <code>error TS2315: Type 'MouseEvent' is not generic.</code>.</p>
  
  <p>Why?</p>
  
  <p>Excerpt from my <code>package.json</code>:</p>
  
  <pre><code> "devDependencies": {
      "@types/react": "^16.0.7",
      "@types/react-dom": "^15.5.5",
      "ts-loader": "^2.3.7",
      "typescript": "^2.5.3",
      "webpack": "^3.6.0"
    },
    "dependencies": {
      "react": "^16.0.0",
      "react-dom": "^16.0.0"
    }
  </code></pre>
  
  <p><strong>Edit #1:</strong></p>
  
  <p>Binding in <code>render()</code>:</p>
  
  <pre><code>&lt;button onClick={ this.ButtonClickHandler }&gt;Toggle&lt;/button&gt;
  </code></pre>
  
  <p>in <code>constructor</code>:</p>
  
  <pre><code>this.ButtonClickHandler = this.ButtonClickHandler.bind(this);
  </code></pre>