How to type a function with column key of table
I can't get this to type correctly. I want
field
to be a column of table
, but typescript keeps saying Type 'Field' cannot be used to index type 'TTable'
. What's the best way to do this?
5 Replies
How about:
@Angelelz I get an error trying to pass
column
to option
with that:
I would just cast it and call it a day:
@Angelelz I found that this works fine with typesafety
But I wish I didn't have to make a call to
getTableColumns
to make it work. It's not too bad, though.This is a great idea! I don't see too many downsides to this