title: How to create columns dynamically from data in antd?
body: <p>I want to create a reusable data table component using antd where columns create dynamically from data. How can I do that?</p>
  <p>here is my code:</p>
  <pre><code> const data= [
    {
      key: 1,
      name: 'Jack',
      email:'jack@gmail.com',
      address: 'Dhaka'
    },
    {
      key: 2,
      name: 'jon',
      email:'jon@gmail.com',
      address: 'Dhaka'
    }
  ];
  
  const TableContainer = (props) =&gt; {
    const { columns, data, loading } = props;
  
    return &lt;Table columns={columns} dataSource={data} loading={loading} /&gt;;
  };
  
  export default TableContainer;
  </code></pre>