title: Passing an empty function into a React component
body: <p>I have a React component; for example:</p>
  
  <pre><code>export class Component1 extends Component&lt;IProps, IState&gt; {
  </code></pre>
  
  <p>One of the props that it accepts is a function:</p>
  
  <pre><code>export interface IProps {    
      a: number,
      b: number,
      onMouseClick: () =&gt; void
  }
  </code></pre>
  
  <p>So, when I use this component, I can do something like this:</p>
  
  <pre><code>&lt;Component1 onMouseClick={() =&gt; this.DoStuff()} a={1} b={2} /&gt;
  </code></pre>
  
  <p>But what if I want to pass a null function in, so that the function does nothing on Mouse Click; for example:</p>
  
  <pre><code>&lt;Component1 onMouseClick={() =&gt; void} a={1} b={2} /&gt;
  </code></pre>
  
  <p>Typescript moans at me, saying that it expects an expression.  I can declare an empty function; like this:</p>
  
  <pre><code>&lt;Component1 onMouseClick={() =&gt; function(){}} a={1} b={2} /&gt;
  </code></pre>
  
  <p>Is there a nicer way that declaring an empty function?  I'm also a little unclear why I can assign the property <code>onMouseClick</code> to void in the IProps definition, but not when using the component.</p>