title: How to convert multiple Objects to an Array [] of key-value pairs in javascript
body: <p>I'm trying to display a table in react-native but it requires the data to be in arrays,</p>
  
  <p>the API returns an object with all the rows, so far I have managed to convert only if there is a single row and doesn't convert the second row if its available.</p>
  
  <p>Api from the server</p>
  
  <pre><code>0: {title: "Transportation", amount: "100"}
  1: {title: "Food", amount: "50"}
  </code></pre>
  
  <p>what I need is </p>
  
  <pre><code>0:["Transportation", "100"]
  1:["Food", "50"]
  </code></pre>
  
  <p>this is my code</p>
  
  <pre><code>const state = this.state;
  let table = this.state.payments;
  console.log(table);
  const tableD = Object.keys(table[0]).map((key, index) =&gt; table[0][key]);
  console.log(tableD);
  const tableData = [tableD];
  console.log(tableData);
  return (
      &lt;Table borderStyle={{borderWidth: 2, borderColor: theme.colors.primary}}&gt;
      &lt;Row data={state.tableHead} style={{ height: 40, backgroundColor: theme.colors.gray2}} textStyle={{margin: 6}}/&gt;
      &lt;Rows data={tableData} textStyle={{ margin: 6, }}/&gt;
      &lt;/Table&gt;
  )
  </code></pre>
  
  <p>this is the error that I get </p>
  
  <blockquote>
    <p>Invariant Violation: Objects are not valid as a React child (found:
    object with keys {title, amount}). If you meant to render a collection
    of children, use an array instead.</p>
  </blockquote>
  
  <p>What could I be doing wrong?</p>