title: Parsing nested json data to json in reactjs
body: <p>I need to parse nested JSON data to normal JSON which is coming from an API and need to pass that JSON data to a react table (am using the react-table library) like below :</p>
  <p><strong>Nested Json data:</strong></p>
  <pre><code>      {
         &quot;value&quot;:[
            {
               &quot;id&quot;:&quot;d38070fd&quot;,
               &quot;name&quot;:&quot;webwhatsapp&quot;,
               &quot;url&quot;:&quot;webwhatsapp.com&quot;,
               &quot;project&quot;:{
                  &quot;id&quot;:&quot;89ea5860-8dce&quot;,
                  &quot;name&quot;:&quot;whatsapp&quot;,
                  &quot;url&quot;:&quot;&quot;,
                  &quot;state&quot;:&quot;well&quot;,
                  &quot;revision&quot;:10612,
                  &quot;visibility&quot;:&quot;private&quot;,
                  &quot;lastUpdateTime&quot;:&quot;2021-01-27T11:30:55.523Z&quot;
               },
               &quot;defaultBranch&quot;:&quot;branchname&quot;,
               &quot;size&quot;:33758407,
               &quot;remoteUrl&quot;:&quot;remote&quot;,
               &quot;sshUrl&quot;:&quot;ssh&quot;,
               &quot;webUrl&quot;:&quot;weburl&quot;,
               &quot;isDisabled&quot;:false
            },
            {
               &quot;id&quot;:&quot;b0dd02f7&quot;,
               &quot;name&quot;:&quot;git&quot;,
               &quot;url&quot;:&quot;github.com&quot;,
               &quot;project&quot;:{
                  &quot;id&quot;:&quot;89ea5860&quot;,
                  &quot;name&quot;:&quot;core&quot;,
                  &quot;url&quot;:&quot;github.com&quot;,
                  &quot;state&quot;:&quot;well&quot;,
                  &quot;revision&quot;:10612,
                  &quot;visibility&quot;:&quot;private&quot;,
                  &quot;lastUpdateTime&quot;:&quot;2021-01-27T11:30:55.523Z&quot;
               },
               &quot;defaultBranch&quot;:&quot;branchname&quot;,
               &quot;size&quot;:30654059,
               &quot;remoteUrl&quot;:&quot;url&quot;,
               &quot;sshUrl&quot;:&quot;url.git&quot;,
               &quot;webUrl&quot;:&quot;url.git&quot;,
               &quot;isDisabled&quot;:false
            },
              ]
               },
               count: 90
              }
  </code></pre>
  <p><strong>To this JSON:</strong></p>
  <pre><code>{
     &quot;value&quot;:[
        {
           &quot;id&quot;:&quot;d38070fd&quot;,
           &quot;name&quot;:&quot;webwhatsapp&quot;,
            &quot;url&quot;:&quot;webwhatsapp.com&quot;,
           &quot;defaultBranch&quot;:&quot;branchname&quot;,
           &quot;size&quot;:33758407,
           &quot;remoteUrl&quot;:&quot;remote&quot;,
           &quot;sshUrl&quot;:&quot;ssh&quot;,
           &quot;webUrl&quot;:&quot;weburl&quot;,
           &quot;isDisabled&quot;:false
           &quot;project.id&quot;:&quot;89ea5860-8dce&quot;,
            &quot;project.name&quot;:&quot;whatsapp&quot;,
            &quot;project.url&quot;:&quot;&quot;,
             &quot;project.state&quot;:&quot;well&quot;,
             &quot;project.revision&quot;:10612,
             &quot;project.visibility&quot;:&quot;private&quot;,
             &quot;project.lastUpdateTime&quot;:&quot;2021-01-27T11:30:55.523Z&quot;
           
          
            
        },
        {
           &quot;id&quot;:&quot;b0dd02f7&quot;,
           &quot;name&quot;:&quot;git&quot;,
           &quot;url&quot;:&quot;github.com&quot;,
            &quot;defaultBranch&quot;:&quot;branchname&quot;,
           &quot;size&quot;:30654059,
           &quot;remoteUrl&quot;:&quot;url&quot;,
           &quot;sshUrl&quot;:&quot;url.git&quot;,
           &quot;webUrl&quot;:&quot;url.git&quot;,
           &quot;isDisabled&quot;:false
              &quot;project.id&quot;:&quot;89ea5860&quot;,
              &quot;project.name&quot;:&quot;core&quot;,
              &quot;project.url&quot;:&quot;github.com&quot;,
              &quot;project.state&quot;:&quot;well&quot;,
              &quot;project.revision&quot;:10612,
              &quot;project.visibility&quot;:&quot;private&quot;,
              &quot;project.lastUpdateTime&quot;:&quot;2021-01-27T11:30:55.523Z&quot;
           
          
        },
  </code></pre>
  <p><strong>Below is the code:</strong></p>
  <pre><code>import React, { useState, useEffect } from &quot;react&quot;;
  import { Row, Col } from &quot;react-bootstrap&quot;;
  import axios from &quot;axios&quot;;
  
  const App = () =&gt; {
     const[data,setData] = useState()
      let api = &quot;apiurl&quot;;
      let token = &quot;token&quot;;
          
              useEffect(() =&gt; {
                  axios.get(api, { headers: {&quot;Authorization&quot; : `Basic ${token}`} })
              .then(res =&gt; {
                
                  console.log(res)
                  setData(res)
              })
              .catch(err =&gt;{
                  
                  console.log('error',err)
              })
                  
              },[]);
              
              }
       
  export default App;
  </code></pre>
  <p>I can see the data in the console but am unable to parse JSON like above.
  Can someone please help with this?
  Thanks in advance</p>