title: How to access object properties of 'key' object reactJS
body: <p>Would like to output this JSON data</p>
  
  <p>I am struggling to find a way to output this data which I am pulling from Firebase, mostly in that I do not know how to select the objects within the 'date' object. Firebase generates these keys automatically: <code>-LMgzJGM78f0BHbPf8cc</code>.</p>
  
  <p>I am not able to output the properties of the objects named as above^ I have tried using nested <code>for(in)</code> loops.</p>
  
  <p>Here is the code I am using currently:</p>
  
  <p>To pull the data from the database</p>
  
  <pre><code> componentDidMount() {
      axios.get('./tasks.json')
        .then(response =&gt; {
          const fetchedTasks = [];
          for (let date in response.data) {
            fetchedTasks.push({
              ...response.data[date],
              date: date,
            });
            for (let item in response.data[date]) {
              fetchedTasks.push({
                ...response.data[date[item]],
                id: item
              })
            }
          }
          this.setState((prevState, props) =&gt; {
            return {
              taskList: fetchedTasks,
              loading: false
            }
          })
        })
        .catch(error =&gt; console.log(error));
    }
  </code></pre>
  
  <p>Mapping the state to a JSX element, only outputs like <code>props.name</code>:</p>
  
  <pre><code>  {this.state.taskList.map((array, index) =&gt; (
              &lt;CompleteTask
                key={array.date}
                taskName={array.date}
              /&gt;
            ) )
          }
  </code></pre>
  
  <p>Here is an example the data as a JSON file, it is set to the state in my app:</p>
  
  <pre><code>{
    "tasks" : {
      "09182018" : {
        "-LMgzJGM78f0BHbPf8cc" : {
          "hours" : 0,
          "end" : "2018-09-18T14:02:25.022Z",
          "minutes" : 0,
          "name" : "sadflkjdsalkf",
          "seconds" : 2,
          "start" : "2018-09-18T14:02:22.508Z"
        },
        "-LMgzaEYe0tcCjpxOuPU" : {
          "hours" : 0,
          "end" : "2018-09-18T14:03:38.635Z",
          "minutes" : 0,
          "name" : "safd",
          "seconds" : 2,
          "start" : "2018-09-18T14:03:36.353Z"
        }
      },
    }
  }
  </code></pre>
  
  <p>The properties of the key elements <code>-LMgzaEYe0tcCjpxOuPU</code> I am unsure of how to access, these data are created by another part in my app, should I move to a more shallow state to output the properties of 'hours','name', mintutes etc. or is there a way to access it as it is now?</p>
  
  <p>Many thanks in advance.</p>