ReactJS how to loop through dynamically named refs
<p>I'm looking at a line of code that has dynamically named refs for an input, where 'item' is an incrementing value starting at zero. </p>

<p>"input type="text" ref={'name'+item} defaultValue={item} />"</p>

<p>How would I loop through these dynamic refs to scrape out the values?  I tried this with no luck.  It tells me object undefined.  (the length of inputs will equate to the number of added elements)</p>

<pre><code>var arr = this.state.inputs;
var arrayLength = arr.length;
for (var i = 0; i &lt; arrayLength; i++) {
    var c = this.refs.name + i.value
    alert(c);
}
</code></pre>

<p>Though, this DOES work, but its dynamic, so I need to loop through it, not hard code it:</p>

<pre><code>alert(this.refs.name0.value);
alert(this.refs.name1.value);
alert(this.refs.name2.value);
</code></pre>