TanStackT
TanStack3mo ago
3 replies
broad-salmon

tanstack table | how do i render <CompA>getValue()</CompA>

im used to rendering like
    {
      id: 'Rank',
      header: 'Rank',
      accessorKey: 'rank',
      cell: ({ getValue }) =>
        renderSnippet(
          createRawSnippet(() => ({
            render: () => `<div class="text-left">#${getValue()}</div>`,
          })),
        ),
    },

// or
    {
      id: 'Status',
      header: 'Status',
      accessorKey: 'timestamp',
      cell: ({ getValue }) => renderComponent(StatusLabel, { timestamp: getValue() }),
    },

// or even
    {
      id: 'Site Method',
      header: 'Site Method',
      accessorKey: 'site',
      cell: ({ row }) =>
        renderComponent(Site, {
          site: row.original.site,
          method: row.original.method,
          layoutVariant: 'siteMethod',
        }),
    },


however i dont know how to render something like <CompA>getValue()</CompA> in the table without kind of having it like <CompA captured={capturedVal}/> im using the shadncn Badge component not my own custom component i can pass a prop to
Was this page helpful?