diff --git a/docs/List.md b/docs/List.md
index 67ed5c41283..49baf284ea5 100644
--- a/docs/List.md
+++ b/docs/List.md
@@ -110,8 +110,13 @@ const ListActions = () => (
);
+const postFilters = [
+ ,
+ ,
+];
+
export const PostList = () => (
- }>
+ } filters={postFilters}>
...
diff --git a/packages/ra-ui-materialui/src/list/filter/FilterButton.tsx b/packages/ra-ui-materialui/src/list/filter/FilterButton.tsx
index adf059f46d5..91084c841ac 100644
--- a/packages/ra-ui-materialui/src/list/filter/FilterButton.tsx
+++ b/packages/ra-ui-materialui/src/list/filter/FilterButton.tsx
@@ -57,7 +57,9 @@ export const FilterButton = (props: FilterButtonProps): JSX.Element => {
const anchorEl = useRef();
if (filters === undefined) {
- throw new Error('FilterButton requires filters prop to be set');
+ throw new Error(
+ 'The component requires the prop to be set'
+ );
}
const hiddenFilters = filters.filter(