File tree 2 files changed +9
-2
lines changed
packages/ra-ui-materialui/src/list/filter
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,13 @@ const ListActions = () => (
110
110
< / TopToolbar>
111
111
);
112
112
113
+ const postFilters = [
114
+ < TextInput label= " Search" source= " q" alwaysOn / > ,
115
+ < TextInput label= " Title" source= " title" defaultValue= " Hello, World!" / > ,
116
+ ];
117
+
113
118
export const PostList = () => (
114
- < List actions= {< ListActions/ > }>
119
+ < List actions= {< ListActions/ > } filters = {postFilters} >
115
120
< DatagridConfigurable>
116
121
...
117
122
< / DatagridConfigurable>
Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ export const FilterButton = (props: FilterButtonProps): JSX.Element => {
57
57
const anchorEl = useRef ( ) ;
58
58
59
59
if ( filters === undefined ) {
60
- throw new Error ( 'FilterButton requires filters prop to be set' ) ;
60
+ throw new Error (
61
+ 'The <FilterButton> component requires the <List filters> prop to be set'
62
+ ) ;
61
63
}
62
64
63
65
const hiddenFilters = filters . filter (
You can’t perform that action at this time.
0 commit comments