title: React-Native/Firebase Insert and sort by timestamp
body: <p>I've been working in react-native recently as I'm building a basic app where you can have a list of gigs, each having an associated date which is inserted into firebase as a timestamp.</p>
  
  <p>I wanted to check but what's the best approach to sorting an array by date so that the list displays with the most recent please? </p>
  
  <pre><code>componentWillMount() {
      this.props.gigsFetch();
  
      this.createDataSource(this.props);
  }
  
  componentWillReceiveProps(nextProps) {
      this.createDataSource(nextProps);
  }
  
  createDataSource({ gigs }) {
      const ds = new ListView.DataSource({
          rowHasChanged: (r1, r2) =&gt; r1 !== r2
      });
  
      this.dataSource = ds.cloneWithRows(gigs);
  }
  
  
  const mapStateToProps = state =&gt; {
  
      const sortedGigs = _.sortBy(state.gigs, 'date');
  
      const gigs = _.map(sortedGigs, (val, uid) =&gt; {
          return { ...val, uid };
      });
  
      return { gigs };
  };
  </code></pre>
  
  <p>Thank you! </p>