fix(data-table): require "id" in DataTableRow interface

This commit is contained in:
Eric Liu 2020-11-26 10:01:11 -08:00
commit 28f2d8190f
5 changed files with 13 additions and 5 deletions

View file

@ -2655,9 +2655,9 @@
"ts": "type DataTableHeader = DataTableNonEmptyHeader | DataTableEmptyHeader"
},
{
"type": "Record<DataTableKey, DataTableValue>",
"type": "{ id: any; [key: string]: DataTableValue; }",
"name": "DataTableRow",
"ts": "type DataTableRow = Record<DataTableKey, DataTableValue>"
"ts": "interface DataTableRow { id: any; [key: string]: DataTableValue; }"
},
{
"type": "string",

View file

@ -10,6 +10,8 @@ components: ["DataTable", "Toolbar", "ToolbarContent", "ToolbarSearch", "Toolbar
### Default
The `DataTable` is keyed for both rendering and sorting. You must define a "key" value per object in the `headers` property and an "id" value in `rows`.
<DataTable
headers="{[
{ key: "name", value: "Name" },