Have VisibilityState accept a generic #5609
Unanswered
binaryartifex
asked this question in
Q&A
Replies: 1 comment
-
The problem is that column ids are not necessarily the same as the data key IDs. You can specify a custom column id that is different than the accessorKey. There would have to be more inference done for that, and/or make another generic just for column ids. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im creating a generic component wrapper around tanstack table and im trying to make the developer experience as seamless as possible. one annoyance is the lack of generic for the VisibilityState type. because it explicity expects a type of
[key: string]: boolean
i can't get it to work with something like[key in keyof Person]: boolean
. The premise of this is to have the consumer create the column visibility and ordering states outside the Table component and feed in the state and setStates of them so it can be controlled via other components. Having a type takes the guess work out of defining the leaf columns types which are literally just the keys of the object itself...Beta Was this translation helpful? Give feedback.
All reactions