title: Using filter in a custom list in React Admin
body: <p>I've been trying to implement a filter feature into react admin, for a regular list I haven't had any issue, done it for multiple lists. I used these <a href="https://marmelab.com/react-admin/List.html#building-a-custom-filter" rel="nofollow noreferrer">docs</a> and it was pretty straight forward.</p>
  <p>The issue here is I'm using ListContextProvider and for the life of me, cannot find how to implement filters using this. Trying to implement using the docs provided above yields no results. Anyone that can point me in the right direction?</p>
  <pre><code>import React, { useState } from 'react'
  import {
    Datagrid,
    TextField,
    ReferenceField,
    FunctionField,
    Pagination,
    Loading,
    ListContextProvider,
    useQuery,
  } from 'react-admin';
  import keyBy from 'lodash/keyBy'
  import Button from '@material-ui/core/Button';
  import &quot;../../css/styles.css&quot;;
  
  function CustomList(props) {
    const [page, setPage] = useState(1);
    const [perPage, setPerPage] = useState(50);
    const [sort, setSort] = useState({ field: 'id', order: 'DESC' })
    const { data, total, loading, error } = useQuery({
      type: 'getList',
      resource: 'list',
      payload: {
        pagination: { page, perPage },
        sort,
        filter: { id: props.id },
      }
    });
  
    if (loading) {
      return &lt;Loading /&gt;
    }
    if (error) {
      window.location.reload(false);
    }
  
    return (
      &lt;div&gt;
        &lt;ListContextProvider value={{
          data: keyBy(data, 'id'),
          ids: data.map(({ id }) =&gt; id),
          total,
          page,
          perPage,
          setPage,
          setPerPage,
          setSort: (field, order) =&gt; {
            setSort({ field, order });
          },
          currentSort: sort,
          basePath: &quot;/list&quot;,
          resource: 'lists',
          selectedIds: []
        }}&gt;
          &lt;Datagrid style={{ tableLayout: 'fixed', wordWrap: &quot;break-word&quot; }}&gt;
            &lt;TextField source=&quot;id&quot; /&gt;
            &lt;TextField source=&quot;name&quot; /&gt;
          &lt;/Datagrid&gt;
          &lt;Pagination rowsPerPageOptions={[10, 25, 50, 100]} /&gt;
        &lt;/ListContextProvider&gt;
      &lt;/div&gt;
    );
  }
  
  export default CustomList; 
  </code></pre>