React and Firebase: return single item
<p>I'm trying to return a single item from Firebase into my ReactJS app.</p>

<p>Why does this code not work?</p>

<pre><code>renderItem: function() {
  var id = "-K7rCis1K3wyVnDbLzs3";
  var child = &lt;h2&gt;{this.state.items[id].title}&lt;/h2&gt;
  return child;
},
</code></pre>

<p>In the console it says:
Cannot read property 'title' of undefined</p>

<p>I can return a single item with all the data in it, but not just the title.
What would the correct syntax be for this?</p>

<p>Thanks :)</p>

<p><strong>* EDIT *</strong>
Here's the complete code</p>

<pre><code>var HelloWorld = React.createClass({
    mixins: [ReactFireMixin],
    getInitialState: function() {
      return {
        items: {},
        loaded: false
      };
    },
    componentWillMount: function() {
      fb = new Firebase("firebasepath");
      this.bindAsObject(fb, "items");
      fb.on("value", this.handleDataLoaded);
    },

    render: function() {
      return &lt;div&gt;
        {this.renderItem()}
      &lt;/div&gt;
    },
    renderItem: function() {
      var id = "-K7rCis1K3wyVnDbLzs3";
      var child = &lt;h2&gt;{this.state.items[id].title}&lt;/h2&gt;
      return child;
    },

    handleDataLoaded: function() {
      this.setState({loaded: true});
    }

  var element = React.createElement(HelloWorld);
  React.render(element, document.body);
</code></pre>