I\'m using Typescript with React. I\'m having trouble understanding how to use refs so as to get static typing and intellisense with respect to the react nodes referenced by
From React type definition
type ReactInstance = Component | Element;
....
refs: {
[key: string]: ReactInstance
};
So you can access you refs element as follow
stepInput = () => ReactDOM.findDOMNode(this.refs['stepInput']);
without redefinition of refs index.
As @manakor mentioned you can get error like
Property 'stepInput' does not exist on type '{ [key: string]: Component | Element; }
if you redefine refs(depends on IDE and ts version you use)