title: AntD rowSelection functional Component
body: <p>I'm trying to grab the single element key in the table.
  But I get undefined How can I grab the id?</p>
  <p><a href="https://ant.design/components/table/#components-table-demo-expand-children" rel="noreferrer">https://ant.design/components/table/#components-table-demo-expand-children</a></p>
  <pre><code>const [select, setSelect] = useState({
      selectedRowKeys: [],
      loading: false,
    });
  
  console.log(&quot;selectedRowKeys&quot;, select);
  
  const { selectedRowKeys, loading } = select;
  
  const rowSelection = {
  selectedRowKeys,
  onChange: (selectedRowKeys) =&gt; {
    setSelect({
      ...select,
      selectedRowKeys: [...select.selectedRowKeys, selectedRowKeys],
    });
  },
  };
  
  return (
  &lt;div&gt;
    &lt;Table
      columns={columns}
      rowSelection={rowSelection}
      dataSource={dataSource}
      loading={!props.employeeList}
    /&gt;
  &lt;/div&gt;);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/pun0p.jpg" rel="noreferrer">Here's a screenshot of console.log()</a></p>