T
TanStack5mo ago
sensitive-blue

custom filterFn typescript type

How do I extend filterFn types with my custom filter?? i defnied my new custom filter in filterFns but typescript yells at me when I use it in the column definitions. Nothing in the docs shows how to exted the interface.
1 Reply
sensitive-blue
sensitive-blueOP5mo ago
This doesnt seem to help with ts errors..
declare module '@tanstack/react-table' {
interface FilterFns {
arrIncludesSomeKebabCaseValue?: FilterFn<any>;
}
}

declare module '@tanstack/react-table' {
interface FilterFns {
arrIncludesSomeKebabCaseValue?: FilterFn<any>;
}
}

Got it. Had to include options filter.
filterFns: {
...options.filterFns,
arrIncludesSomeKebabCaseValue: ...
},
filterFns: {
...options.filterFns,
arrIncludesSomeKebabCaseValue: ...
},

Did you find this page helpful?