You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if the display and sort method’s parameter types were automatically inferred, somehow.
It seems tricky, as having both rows and headers types related would create a circular dependency.
But, in order to force the rows array to have objects with a set of keys defined in headers:
// Typing `rows` with a `headersList` arrayconstheadersList=["name","quantity","date"]asconst;typeDataTableRows={[PintypeofheadersList[number]|"id"]: string;};constrows: DataTableRows=[{id: 1,nam: "John",// Will trigger a TS errorquantity: 157.89,date: "2020-10-21",},];
The text was updated successfully, but these errors were encountered:
It would be great if the
display
andsort
method’s parameter types were automatically inferred, somehow.It seems tricky, as having both rows and headers types related would create a circular dependency.
But, in order to force the
rows
array to have objects with a set of keys defined inheaders
:The text was updated successfully, but these errors were encountered: