Replies: 3 comments
-
Same issue. It even says in the docs that the declaration is global. It's for the table meta but it makes no difference:
|
Beta Was this translation helpful? Give feedback.
-
Ran into the same issue. I have multiple react tables that previously passed in meta data as column props. Trying to move away from that to statically defined columns and pass in all callback functions as table meta. However, I'm running into this issue now where the metadata is globally defined and it's creeping in to each table. The idea of declaring the TS module in-line to extend the types feels antiquated and I don't see that much anymore in the TS ecosystem. Ideally you could do something like this:
To allow dynamically scoping this. React-hook-form follows this and it works really nicely. It allows you to defined the data type for the specific form, and then any specific context that gets passed in to the validators and is nicely scoped. This would be a nice improvement to Table. One way to get around this is to add scoping to your types themselves like so:
...elsewhere...
|
Beta Was this translation helpful? Give feedback.
-
This is a weakness of declaration merging. Hoping to be able to avoid declaration merging in V9 |
Beta Was this translation helpful? Give feedback.
-
Hi.
I added meta to columns via this: https://tanstack.com/table/v8/docs/api/core/column-def#meta
But i have in my project two tables with different meta. So i must declare all meta from two tables as optional? Or maybe there is a different way to declare meta for each table?
Beta Was this translation helpful? Give feedback.
All reactions