tsx // initializing column helper function with argument type similar to that of column object parameters data type value.
const columnHelper = createColumnHelper<typeof columns>();
// getting the values of keys for displaying header fields
const columns = useMemo(
() =>
Object.keys(metaData[0]).map((key, id) => {
return columnHelper.accessor(key.toString(), {
header: key.toUpperCase(),
});
}),
[]
);
const defaultColumn = {
cell: (props) => {
console.log(props);
<input value={props.getValue()} />;
},
};
const table = useReactTable({
data,
columns,
defaultColumn,
getCoreRowModel: getCoreRowModel(),
});
const handleTableRowHandler = (
id,
value,
e: React.MouseEvent<HTMLElement>
) => {
e.preventDefault();
if (isSelected === id) {
setIsSelected(null);
} else {
setIsSelected(id);
// navigate(navPath!, {
// state: value,
// });
setEditRowData(value);
// console.log(value);
}
};
https://x.com/tan_stack/status/2031128535470104577?s=20
dry-scarlet · 17h ago
https://x.com/powersync_/status/2010721010006552775?s=20
dry-scarlet · 2mo ago
You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet · 3mo ago