title: React groupBy and print into table
body: <p>EDITED:
  methods groupBy, omit and mapValue are imported from:</p>
  
  <pre><code>import groupBy from 'lodash/groupBy';
  import mapValues from 'lodash/mapValues';
  import omit from 'lodash/omit';
  </code></pre>
  
  <p>I have this json</p>
  
  <pre><code>[{
      "name": "Jitka",
      "orderNumber": "1",
      "order": false
  },
  {
      "name": "Jitka",
      "orderNumber": "0",
      "order": false
  },
  {
      "name": "Petr",
      "orderNumber": "6",
      "order": false
  }]
  </code></pre>
  
  <p>In react I need group value by name. And after grouping I need data print into table in format</p>
  
  <p><a href="https://i.stack.imgur.com/Sz8Et.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sz8Et.png" alt="enter image description here"></a>
  The problem is, how convert this data, which I groupBy name into table in this format.</p>
  
  <p>My code is: </p>
  
  <pre><code>{
          const ordersByName = groupBy(this.state &amp;&amp; this.state.orders, 'name');
          let order = mapValues(ordersByName, x =&gt; x.map(y =&gt; omit(y, 'name')));
          this.state.sortedOrders.push(order);
  
      }
  
      return (
          &lt;div&gt;
              &lt;MyNavbar/&gt;
              &lt;div className="container"&gt;
                  &lt;table className="table"&gt;
                      &lt;tbody&gt;
                      &lt;tr&gt;
                          &lt;th&gt;Name&lt;/th&gt;
                          &lt;th&gt;Order number&lt;/th&gt;
                          &lt;th&gt;Order&lt;/th&gt;
                      &lt;/tr&gt;
                      {this.state.sortedOrders.map((offer) =&gt; {
                          console.log(offer);
  
                      })}
                      &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>Thank you.</p>