Created
March 1, 2021 18:21
-
-
Save nafeu/58e7bf70c0a8aefaba40a2dd3e86eae5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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