Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nafeu/58e7bf70c0a8aefaba40a2dd3e86eae5 to your computer and use it in GitHub Desktop.
Save nafeu/58e7bf70c0a8aefaba40a2dd3e86eae5 to your computer and use it in GitHub Desktop.
const TableInstance = ({ tableData }) => {
const [columns, data] = useMemo(
() => {
const columns = [
{
Header: 'Topic',
accessor: 'name'
},
{
Header: 'Active Members',
accessor: 'active'
},
{
Header: 'Status',
accessor: 'status'
},
{
Header: 'Upvotes',
accessor: 'upvotes'
}
];
return [columns, tableData];
},
[tableData]
);
const tableInstance = useTable({ columns, data });
return (
<TableLayout {...tableInstance} />
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment