title: Select the table rows by default based on the data in antd table
body: <p>I'm new to antd and I'm stuck at one place in my project. I want to check/select the checkboxes of rows by default based on the sourcedata or data.</p>
  
  <p>for example if i have the datasource as</p>
  
  <pre><code>const data =
  [ 
  {
  key: "1",
  name: "John",
  age: 22,
  chosen: true,
  working: null
  },
  {
  key : "2",
  name: "Jason",
  age: 23,
  chosen: false,
  working: 'John'
  }]
  </code></pre>
  
  <p>So based on datasource if any object has chosen key as true, I want to check/select the checkbox of those rows by default.</p>
  
  <p>I can filter out the data array depending on the chosen key has the value true or not. But how to check the checkbox by default? Is there any prop for the antd table, which will take the array of filtered data and check/select the checkbox for those rows?</p>
  
  <p>I tried to check the rows using checked attribute inside getCheckboxProps but when I use that in console I get a warning saying "Warning: [antd: Table] Do not set <code>checked</code> or <code>defaultChecked</code> in <code>getCheckboxProps</code>. Please use <code>selectedRowKeys</code> instead."</p>
  
  <p>Below is the code which I'm currently using.</p>
  
  <pre><code>const data =
  [ 
   {
    key: "1",
    name : "John",
    age : 22,
    chosen: true,
    working: null
   },
   {
    key : "2",
    name: "Jason",
    age: 23,
    chosen: false,
    working: "John"
   }
  ]
  
  const fiterSelectedRows = data.filter(row =&gt; {
          return row.chosen;
  });
  
  const rowSelection = {
          onChange: (selectedRowKeys, selectedRows) =&gt; {
              console.log(
                  `selectedRowKeys: ${selectedRowKeys}`,
                  "selectedRows: ",
                  selectedRows
              );
          },
          getCheckboxProps: record =&gt; {
              return {
                  disabled: record.working != null,
                  name: record.working
              };
          }
  };
  
  &lt;Table rowSelection={rowSelection} columns={columns} dataSource={data}/&gt;
  </code></pre>