Default filterFn
How can I avoid having to specify "filterFn: customTextFilter" on each column, I want it on all columns that have "showFilter: true" ?

4 Replies
national-gold•2y ago
As far as I know, you need to pass something into the filterFn key on the Column definitions.
You could, avoid having to pass in the direct function every time and just refer to it via a string using registering a set of default filter functions on the useReactTable hook.
https://tanstack.com/table/v8/docs/api/features/filters#table-options
Filters | TanStack Table Docs
Can-Filter
The ability for a column to be column filtered is determined by the following:
correct-apricot•2y ago
what is the default filterFn set to, I couldn't seem to find it in the docs?
yappiest-sapphire•2y ago
set it up in the
defaultColumn
table optioncorrect-apricot•2y ago
so for each one of my columns I have
filterFn: "equalsString"
I was just wondering if anyone knew what the default setting for that config is?
thanks for the default column id thats does help me a lot 🙂