Running ES6 on top of Reactjs. Suppose I want to reference a node with firstName like this:
var el = React.findDOMNode(this.refs.firstName);
but type = 'firstName'
. So I need to do something like this:
var el = React.findDOMNode(this.refs.{type});
And I've tried a handful of different variations and nothing works. I know the answer is very simple but I can't find it as I'm very much a newbie! I think this relates to string literals? Thanks in advance for your help!