title: Dynamic Column and Row In datagrid in React JS
body: <p>I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS. I need dynamic column and row in Data Grid in react JS.
  Here is my code.</p>
  <pre><code>    let response_data = {initial_data: [
      {
        &quot;id&quot;:1,
        &quot;Did I see this plant in 2016?&quot;:&quot;No&quot;,
        &quot;Did I see this plant in 2017?&quot;:&quot;Yes&quot;,
        &quot;How Many?&quot;:1,
        &quot;User Data 4&quot;:&quot;x&quot;,
        &quot;User Data 5&quot;:'nil',
        &quot;Did I see this plant in 2022?&quot;:&quot;No&quot;,
        &quot;Name&quot;:&quot;Abronia alpina&quot;
        },
       {
        &quot;id&quot;:2,
        &quot;Did I see this plant in 2016?&quot;:&quot;No&quot;,
        &quot;Did I see this plant in 2017?&quot;:&quot;No&quot;,
        &quot;How Many?&quot;:11,
        &quot;User Data 4&quot;:&quot;x&quot;,
        &quot;User Data 5&quot;:'nil',
        &quot;Did I see this plant in 2022?&quot;:&quot;Yes&quot;,
        &quot;Name&quot;:&quot;Abronia alpina1&quot;
       }
     ]
     };
  
    let row = response_data.initial_data
    let columns = Object.keys(response_data.initial_data).map((key, id)=&gt;{
     [{
      field: key,
      headerName: key,
      width: 100
     }]
    })
  
  return{
    &lt;DataGrid
            components={{ Toolbar: QuickSearchToolbar }}
            rows={rows}
            columns={columns}
            pageSize={pageSize}
            rowsPerPageOptions={[5, 10, 20]}
            autoHeight={true}
            onPageSizeChange={(newPageSize) =&gt; setPageSize(newPageSize)}
            pagination
            componentsProps={{
              toolbar: {
                value: searchText,
                onChange: (event) =&gt;
                  requestSearch(event.target.value),
                clearSearch: () =&gt; requestSearch(&quot;&quot;),
              },
            }}
          /&gt;
  }
  </code></pre>
  <p>I need column and row should be dynamic, not static using react JS.</p>