title: React loop output
body: <p>I'm new to React / JS, so not sure how to do it.</p>
  
  <p>Please see below my json, code, current output and expected output. </p>
  
  <p>I've managed to get the current output but it's a slightly different json that has the date in the key under each title. Struggling with how to get the expected output.</p>
  
  <p>Would be great if someone could assist.</p>
  
  <p>Thanks</p>
  
  <pre><code>--- JSON ---
  {
      "success": true,
      "data": {
          "2018-12-05": [
              {
                  "id": 1,
                  "title": "Title 1",
              },
              {
                  "id": 2,
                  "title": "Title 2",
              }
          ],
          "2019-01-12": [
              {
                  "id": 3,
                  "title": "Title 3",
              }            
          ]
      },
      "message": "Data retrieved successfully"
  }
  
  --- React code ---
  componentDidMount() {
      fetch('/api/names')
      .then(res =&gt; res.json())
      .then(
          (result) =&gt; {
              this.setState({
                  names: result.data,
              });
          },
      )
  }
  
  render() {
      var { names } = this.state;
      return (
      {names.map(name =&gt; (
          &lt;tr key={name.id}&gt;
              &lt;td scope="row"&gt;{name.title}&lt;/td&gt;
          &lt;/tr&gt;
      ))}
    );
  }
  
  --- Expected Output ---
  2018-12-05
      Title 1
      Title 2
  2019-01-12
      Title 3
  </code></pre>