Skip to content

Instantly share code, notes, and snippets.

@cinaglia
Created February 1, 2019 20:36
Show Gist options
  • Save cinaglia/de50682469ebd41311dd1ca314300ddc to your computer and use it in GitHub Desktop.
Save cinaglia/de50682469ebd41311dd1ca314300ddc to your computer and use it in GitHub Desktop.
Sortable TableHead API
<TableHead
activeKey={currentKey}
direction={currentDirection}
onSort={({ key, direction }) => { console.log(key, direction); }}
>
<TableHead.Item>Id</TableHead.Item>
<TableHead.Sortable key="type">Type</TableHead.Sortable>
<TableHead.Sortable key="slug">Slug</TableHead.Sortable>
<TableHead.Item>Name</TableHead.Item>
<TableHead.Item>URL</TableHead.Item>
<TableHead.Sortable key="created_at">Created</TableHead.Sortable>
<TableHead.Item />
</TableHead>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment