title: Reactjs: Key undefined when accessed as a prop
body: <p>Tools: Reactjs 0.14.0 Vanilla Flux</p>
  <p>I need unique identifiers for 2 reasons:</p>
  <ol>
  <li><a href="https://facebook.github.io/react/docs/multiple-components.html#child-reconciliation" rel="nofollow noreferrer">Child Reconciliation</a></li>
  <li><a href="http://facebook.github.io/react/tips/expose-component-functions.html" rel="nofollow noreferrer">Keeping track of what child was clicked</a></li>
  </ol>
  <p>So let's say I have a list of messages that looks like this:</p>
  <pre><code>[
      {
        id: 1241241234,  // &lt;-----The unique id is kept here
        authorName: &quot;Nick&quot;
        text: &quot;Hi!&quot;
      },
      ...
  ]
  </code></pre>
  <p>And now I use a <code>Array.prototype.map()</code> to create <a href="https://facebook.github.io/react/docs/multiple-components.html#ownership" rel="nofollow noreferrer">&quot;ownee&quot;</a> component (<code>MessageListItem</code>) inside of the owner component <code>MessageSection</code></p>
  <pre><code>function getMessageListItem(message) {
      return (
          &lt;MessageListItem key={message.id} message={message} /&gt;
      );
  }
  
  var MessageSection = React.createClass({
      render: function() {
          var messageListItems = this.state.messages.map(getMessageListItem);
          &lt;div&gt;
              {messageListItems }
          &lt;/div&gt;
      }
  });
  </code></pre>
  <p>But the <code>this.props.key</code> is undefined in the <code>MessageListItem</code> even though I know for a fact that is was defined when it was passed down.</p>
  <pre><code>var ConvoListItem = React.createClass({
      render: function() {
          console.log(this.props.key); // Undefined
      }
  });
  </code></pre>
  <p>I'm guessing there is a reason that React is not letting <code>key</code> be used as a prop.</p>
  <p>Question:</p>
  <p>If I can't use <code>key</code> as a prop, then what is the proper way to handle the duality need of keying and setting unique identifiers on a dynamic list of child elements that contain state?</p>