<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">when provide a prop with onClick in MenuItem like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="this.handleDialogControl('open', 'dialogPartManage')"><pre class="notranslate"><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">handleDialogControl</span><span class="pl-kos">(</span><span class="pl-s">'open'</span><span class="pl-kos">,</span> <span class="pl-s">'dialogPartManage'</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">a exec funtion, should throw Error</p>

<h2 dir="auto">Current Behavior</h2>

<p dir="auto">when I use this to open dialog, and forget to set it as a arrow-function, like</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="() =&gt; this.handleDialogControl('open', 'dialogPartManage')"><pre class="notranslate"><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">handleDialogControl</span><span class="pl-kos">(</span><span class="pl-s">'open'</span><span class="pl-kos">,</span> <span class="pl-s">'dialogPartManage'</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">It will cause a crash that this page will keep loading.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>

<ol dir="auto">
<li>create a dialog</li>
<li>open it with a MenuItem's onClick prop, with some<br>
code like:</li>
</ol>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// handle method
handleDialogControl = (method, boxName) =&gt; {
    const list = [...this.state.openList];
    
    if (method === 'close') {
      const openList = removeFromOpenList(list, boxName, this.enum);
      return this.setState({ openList });
    }

    if (method === 'open') {
      list.push(boxName);
      return this.setState({ openList: list });
    }

    return new Error('UserError: params invalid');
  }
// use with onClick
&lt;MenuItem onClick={this.handleDialogControl('open', 'dialogAddLink')}&gt;"><pre class="notranslate"><span class="pl-c">// handle method</span>
<span class="pl-s1">handleDialogControl</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">method</span><span class="pl-kos">,</span> <span class="pl-s1">boxName</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">list</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>...<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">state</span><span class="pl-kos">.</span><span class="pl-c1">openList</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">method</span> <span class="pl-c1">===</span> <span class="pl-s">'close'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">const</span> <span class="pl-s1">openList</span> <span class="pl-c1">=</span> <span class="pl-en">removeFromOpenList</span><span class="pl-kos">(</span><span class="pl-s1">list</span><span class="pl-kos">,</span> <span class="pl-s1">boxName</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">enum</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">setState</span><span class="pl-kos">(</span><span class="pl-kos">{</span> openList <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">method</span> <span class="pl-c1">===</span> <span class="pl-s">'open'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-s1">list</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">boxName</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">setState</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">openList</span>: <span class="pl-s1">list</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s">'UserError: params invalid'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-c">// use with onClick</span>
<span class="pl-c1">&lt;</span><span class="pl-v">MenuItem</span> <span class="pl-s1">onClick</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-en">handleDialogControl</span><span class="pl-kos">(</span><span class="pl-s">'open'</span><span class="pl-kos">,</span> <span class="pl-s">'dialogAddLink'</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span></pre></div>
<ol start="3" dir="auto">
<li>then open it in your browser</li>
<li>unexpected keep loading.</li>
</ol>
<h2 dir="auto">Context</h2>
  
<p dir="auto">the Error is difficult to find,(also meet) I should provide some suggest, for this case.</p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>^1.0.0-beta.16</td>
</tr>
<tr>
<td>React</td>
<td>^16.0.0</td>
</tr>
<tr>
<td>browser</td>
<td>chrome at 61.0.3163.100</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>

<p dir="auto">I am trying to use the third AppBar demo on the material-ui-next component demos. Upon insert into my site, it should not error out, as this is a component demo</p>
<h2 dir="auto">Current Behavior</h2>

<p dir="auto">Errors occur in multiple locations - mainly lacking a default for <code class="notranslate">import React from 'react';</code> on the first line, which needs to be changed to <code class="notranslate">import * as React from 'react';</code>. Additionally, on line 33 among others, the following error occurs: <code class="notranslate">(33,21): Parameter 'event' implicitly has an 'any' type.</code></p>
<h2 dir="auto">Steps to Reproduce</h2>

<ol dir="auto">
<li>Download <code class="notranslate">create-react-apps-with-typescript</code> demo from the repo</li>
<li><code class="notranslate">npm install</code></li>
<li>Copy the code from the third AppBar demo into <code class="notranslate">components/appbar.tsx</code></li>
<li>Add <code class="notranslate">&lt;AppBar&gt;</code> component to <code class="notranslate">pages/index.tsx</code></li>
<li><code class="notranslate">yarn start</code></li>
</ol>
<h2 dir="auto">Context</h2>

<p dir="auto">This issue is entirely blocking, as I am unable to begin development on my own sites if the components I should learn from do not work themselves.</p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>beta 33</td>
</tr>
<tr>
<td>React</td>
<td>latest</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</td>
</tr>
<tr>
<td>OS</td>
<td>MacOS High Sierra</td>
</tr>
</tbody>
</table>