title: How to reference JSX component props from array?
body: <p>I have JSX components in an array, and want to reference their props and state by accessing them in the array.</p>
  
  <pre><code>let default = [
      &lt;Space name="1" /&gt;,
      &lt;Space name="2" color="#ffffff" /&gt;
  ]
  
  let selected = default[0];  
  </code></pre>
  
  <p>This gives me the error <code>Cannot read property 'name' of undefined</code> when trying to access the name prop I have set by doing <code>selected.name</code>.</p>
  
  <p>I also tried using an array of regular objects (<code>[new Space('1', '#ffffff'), etc]</code>) and rendering them with a map, but while this let me access props from the array directly, I couldn't access the props from the render method.</p>
  
  <p>I'm new to react so any help is appreciated.</p>