How to reset filter values in react admin framework?
There is a setFilters
prop in your filter component, you can use it:
export const PostsFilter = (props) => (
<div>
<Filter {...props}>
<TextInput label='Post ID' source='id' alwaysOn />
<TextInput label='User ID' source='user_id' alwaysOn />
</Filter>
<Button onClick={() => props.setFilters({
id: '',
user_id: ''
})}>Clear fields</Button>
<div>
);