title: How to deselect list items in react admin custom bulk action buttons
body: <p>I have a react admin project and have implemented a custom button for the List view passed into the <code>bulkActionButtons</code> attribute as described by the docs here: <a href="https://marmelab.com/react-admin/List.html#bulk-action-buttons" rel="nofollow noreferrer">https://marmelab.com/react-admin/List.html#bulk-action-buttons</a></p>
  
  <pre><code>const BulkUserActions = props =&gt; (
    &lt;MakeAdminButton {...props}/&gt;
  );
  
  const UserList = props =&gt; (
    &lt;List {...props} bulkActionButtons={&lt;BulkUserActions/&gt;}&gt;
      &lt;Datagrid rowClick="show"&gt;
        &lt;TextField source="id"/&gt;
        &lt;EmailField source="email"/&gt;
      &lt;/Datagrid&gt;
    &lt;/List&gt;
  );
  </code></pre>
  
  <p>The <code>MakeAdminButton</code> handles the click and performs the update that I need. The missing piece of the puzzle is how to deselect the list items after the action is completed. The <code>props.selectedIds</code> is protected so I am unable to simply set this to an empty array after completing my logic.</p>
  
  <p>Question is how to unset <code>props.selectedIds</code> or other method for deselecting the list items on completion.</p>
  
  <pre><code>const MakeAdminButton = withStyles(styles)(class MakeAdminButton extends React.Component {
  
    handleAction = () =&gt; {
      //does the stuff as required using this.props.selectedIds
  
      //what to return to unset this.props.selectedIds 
    };
  
    render () {
      return &lt;Button variant="contained"
                 color="primary"
                 onClick={this.handleAction}
      &lt;AdminIcon/&gt;
    &lt;/Button&gt;;
    }
  });
  </code></pre>