title: React Native Pass Firebase Object To Next Page - React Navigation
body: <p>I have a list of firebase objects in a React Native ListView. Please see the code below.</p>
  
  <p>Importing the data from Firebase:</p>
  
  <pre><code>getDataForFeed() {
  
      var feedPosts = this;
  
      firebase
        .database()
        .ref("/feedPosts/")
        .limitToLast(10)
        .orderByChild('sortingTime')
        .on("child_added", function(data) {
        var newData = [...feedPosts.state.listViewData];
        newData.push(data);
        feedPosts.setState({ listViewData: newData });
      });
  }
  </code></pre>
  
  <p>Rendering the data:</p>
  
  <pre><code>&lt;ListView
  
     enableEmptySections
     dataSource={this.ds.cloneWithRows(this.state.listViewData)}
  
     renderRow={data =&gt; (
  
     &lt;Card style={{ flex: 0 }}&gt;
  
         &lt;CardItem
         button
         onPress={data =&gt; {
         this.props.navigation.navigate("ViewPost", {
         subject: data.val().subject //This doesn't work.
        });
       }}
      &gt;
  
        &lt;Body&gt;
           &lt;Text small&gt;
              {data.val().subject} //This works.
           &lt;/Text&gt;
        &lt;/Body&gt;
  
       &lt;/CardItem&gt;
  
     &lt;/Card&gt;
    )}
  /&gt;
  </code></pre>
  
  <p>When I put a string or integer in the "subject" value, it works fine, but when I want the value I need, data.val().subject - it throws this error.</p>
  
  <pre><code>data.val is not a function.
  </code></pre>
  
  <p>In the text box below, data.val().subject shows just fine.</p>
  
  <p>Please help me get this into the correct format for me to pass it to the next page.</p>