Skip to content

Is this possible to get onClick in each row? #62

Answered by KevinVandy
italosantana asked this question in Q&A
Discussion options

You must be logged in to vote

Of course, just use a custom Cell render. You can see where I did exactly that for my props table on the docs site. Scroll down to see the full source code on that page, but here is the snippet you want.

{
          accessorKey: 'link',
          header: 'More Info Links',
          Cell: ({ cell, row }) => (
            <Link href={cell.getValue<string>()}>
                {row.original?.linkText}
            </Link>
          ),
        },

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KevinVandy
Comment options

Answer selected by italosantana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants