T
TanStack3y ago
fair-rose

ColumnFilterState more specific types


const [columnFiltersState, setColumnFiltersState] = useState<ColumnFiltersState>([]);
const [columnSearchState, setColumnSearchState] = useState<ColumnFiltersState>([]);
...
...

const [columnFiltersState, setColumnFiltersState] = useState<ColumnFiltersState>([]);
const [columnSearchState, setColumnSearchState] = useState<ColumnFiltersState>([]);
...
...
hi, we have a custom hook that manages manual pagination, sorting, filtering... For the types we use the RT8 ColumnFiltersState, which is { id: string, value: unknown}[]. For the value we use string[]. But we have to add 'as string[]' everywhere. Is there a cleaner way to get around this? Would omitting work here?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?