title: Typescript and React: How to have typed refs?
body: <p>I'm using Typescript with react. If I have a reference, for example</p>
  
  <pre><code>&lt;SomeComponent ref="example-ref"&gt;&lt;/SomeComponent&gt;
  </code></pre>
  
  <p>I can access it the usual way with <code>this.refs['example-ref']</code> and work from there. If I want it typed, I have to explicitly cast it:</p>
  
  <pre><code>var typedRef: SomeComponent = this.refs['example-ref'] as SomeComponent;
  </code></pre>
  
  <p>But how can I have typed references so that I don't have to cast them? Thanks</p>