Reusable cell renderer without 'any' type
Hello,
I was unable to find any post or issue on this, but probably I was searching for the wrong keywords, as I can't believe, that anyone else had this problem :D
I have a function for rendering dates into a readable format in cells, like this:
Now I want to get rid of the any, as I am trying to avoid any types whereever possible. Using unknown or never both leads to problems when using this in a column definition.
Something like this shows up:
Is there any way to solve this? Or do I have to explicitly use any here?
4 Replies
harsh-harlequin•2y ago
The
any
should represent the data type for the whole tablegenetic-orangeOP•2y ago
Is there no way to avoid the any type? In my examle it is irrelevant for the function, which type the data rows have, as only the value is used
harsh-harlequin•2y ago
It looks like the data type for your table is
WebhookResponse
so you can just use thatgenetic-orangeOP•2y ago
In this case yes, but I wanted to have a CellComponent that I can just use in any table.
Sorry for the late reply :)