T
TanStack3y ago
harsh-harlequin

Cell formatting

How do I write this column
{
header: 'Link',
accessorKey: 'url',
accessorFn: ({ url }) => <a href={url} />
}
{
header: 'Link',
accessorKey: 'url',
accessorFn: ({ url }) => <a href={url} />
}
... so the cells contain anchor links instead of the text [object Object]?
1 Reply
harsh-harlequin
harsh-harlequinOP3y ago
Disregard. I got it:
{
header: 'Link',
accessorKey: 'url',
cell: ({ getValue }) => {
const url = getValue()
return <a href={url}>click me</a>
}
}
{
header: 'Link',
accessorKey: 'url',
cell: ({ getValue }) => {
const url = getValue()
return <a href={url}>click me</a>
}
}

Did you find this page helpful?