Why is Tanstack Table giving me a type mismatch in my cell definition #5338
Unanswered
JaegerCryptic
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there. I've been learning how to use react and typescript recently and am currently trying to use Tanstack Table to define a complicated table using generic types for reusability. I'm running into type errors with how I am trying to spread my custom function for cell definition.
The error:
I pass to a function that determines what should be returned
This then returns either a cell that is editable using mui textfield or div with a display value inside.
Here is how the useEditableCell is used:
And then used inside the column definitions here:
I'm just very confused on why this doesn't work when if I were to simply define the column like so:
It works fine. Any help would be appreciated, though everything I am doing is done with a purpose and a specific use case in mind, so I cannot change anything that I am doing.
Beta Was this translation helpful? Give feedback.
All reactions