title: How to loop through an object of arrays create views in react native?
body: <p>So I have an object like so,</p>
  
  <pre><code>Object{ 2017-08-01:Array(2), 2017-08-02:Array(1) }
  </code></pre>
  
  <p>I have used the following code, to iterate through it,</p>
  
  <pre><code>return Object.keys(this.state.visits).map(function(key, index){
              console.log(key);
              return (
                  &lt;View style={{height: 40, flexDirection: 'row'}}&gt;
                      &lt;Text style={{marginLeft: 10,marginTop: 10, fontWeight:'500'}}&gt;{key}&lt;/Text&gt;
                  &lt;/View&gt;
              );
          });
  </code></pre>
  
  <p>What happens is, this code, prints the 'key' perfectly in the console.log, but in the view, only the last date gets printed, and I also get an error in the console like so,</p>
  
  <blockquote>
    <p>Warning: Each child in an array or iterator should have a unique "key"
    prop.</p>
    
    <p>Check the render method of <code>filename</code>. See
    <a href="https://facebook.github.io/react/docs/lists-and-keys.html#keys" rel="nofollow noreferrer">https://facebook.github.io/react/docs/lists-and-keys.html#keys</a> for more information.</p>
  </blockquote>
  
  <p>What I'm trying to achieve is as follows,</p>
  
  <pre><code>+-------------------------------------------------------------+
  |                           Date1                             |
  +-------------------------------------------------------------+
  |                           Record 1                          |
  +-------------------------------------------------------------+
  |                           Record 2                          |
  +-------------------------------------------------------------+
  
  
  +-------------------------------------------------------------+
  |                           Date 2                            |
  +-------------------------------------------------------------+
  |                           Record 1                          |
  +-------------------------------------------------------------+
  </code></pre>
  
  <p>But I got stuck on the date part, so am not being able to proceed.</p>