wispy-yellowW
Refine3y ago
3 replies
wispy-yellow

Questions regarding usage of setFilters of useDataGrid

When I am using the setFilters of useDataGrid in MUI, I faced this problem:

No overload matches this call.
Overload 1 of 2, '(filters: CrudFilters, behavior?: SetFilterBehavior | undefined): void', gave the following error.
Type 'string' is not assignable to type '"in" | "contains" | "eq" | "startswith" | "ne" | "lt" | "gt" | "lte" | "gte" | "nin" | "ncontains" | "containss" | "ncontainss" | "between" | "nbetween" | "null" | "nnull" | "nstartswith" | ... 7 more ... | "and"'.
Overload 2 of 2, '(setter: (prevFilters: CrudFilters) => CrudFilters): void', gave the following error.
Argument of type '{ field: string; value: string; operator: string; }[]' is not assignable to parameter of type '(prevFilters: CrudFilters) => CrudFilters'.
Type '{ field: string; value: string; operator: string; }[]' provides no match for the signature '(prevFilters: CrudFilters): CrudFilters'.

my code is like this, is there anything wrong with my code?
Was this page helpful?