Skip to content

Instantly share code, notes, and snippets.

@dipeshhkc
Created July 8, 2022 11:23
Show Gist options
  • Save dipeshhkc/432b182d84ae5fce5a72299b873564a2 to your computer and use it in GitHub Desktop.
Save dipeshhkc/432b182d84ae5fce5a72299b873564a2 to your computer and use it in GitHub Desktop.
const memberColumns = useMemo(() => {
return [
{
Header: "Domain Name",
accessor: "name",
},
{
Header: "# of Records",
accessor: "number_of_records",
Cell: ({ value }) => {
return <span>{value} records</span>;
},
}
]},[])
<Datatable
columns={memberColumns}
data={data_from_api}
//when clicking on each row
rowClick={(row) => {
navigate(
`/detail/${row?.["id"]}/view`
);
}}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment