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