title: TypeError: undefined is not an object (evaluating..)
body: <p>In console before render() this.state.data1.length is not giving any error but as soon as I use it in view tag this is giving error as : 
  TypeError: undefined is not an object (evaluating '_this.state.data1.length') 
  If I delete this line from view tag then nothing is printed in my reacttable tag and hence I suppose this line is required but what change should I make so that there's no error using react native code and my retrieved data is also printed on my app.</p>
  
  <pre><code>import React, { Component } from 'react';
  import { StyleSheet, View, Text, Button } from 'react-native';
  import ReactTable from 'react-table';
  import firebase from 'firebase';
  
  const firebaseConfig = {
  ...
  };
  firebase.initializeApp(firebaseConfig);
  
  
  export default class Form1 extends Component {
  constructor(props) {
      super(props);
  
      this.state = {
          data: [],
          columns: [
              {
                  Header: "email",
                  accessor: "email"
              },
              {
                  Header: "password",
                  accessor: "password"
              }
          ]
      }
  }
  
  componentDidMount() {
      const data = [];
      const data1 = [];
      var query = firebase.database().ref("/users");
      query.once("value").then((snapshot) =&gt; {
        //console.log(snapshot)
          snapshot.forEach((childSnapshot, index) =&gt; {
  
              let singleObj = {
                  email: childSnapshot.val().email,
                  password: childSnapshot.val().password,
              }
  
             // console.log('email:',data)
              data.push(singleObj);
             this.setState({data1 : data});
            console.log('sssssssssssssssssss',this.state.data1)
          });
      });
  }
  
  submit1=()=&gt;{
  console.log(this.state.data1.length)
  console.log('data1:',this.state.data1)
  }
  
  render() {
      return (
          &lt;View style="styles.container"&gt;
  
              {this.state.data1.length &gt; 0 &amp;&amp; &lt;ReactTable data={this.state.data1} columns={this.state.columns} /&gt;}
                         &lt;Button title='Submit' onPress={this.submit1.bind(this)} /&gt;
  
          &lt;/View&gt;
      );
  }
  }
  
  const styles = StyleSheet.create({
  container: { flex: 1, padding: 16, paddingTop: 30, backgroundColor: '#fff' },
  head: { height: 40, backgroundColor: '#f1f8ff' },
  text: { margin: 6 }
  });
  </code></pre>