Tanstack react-table cannot return tsx from cell function

104 Views Asked by At

just testing Tanstack react-table lib with react + Typescript, and it seams that I can't return tsx/jsx from cell function of ColumnDef:

enter image description here

Am I missing something here?

2

There are 2 best solutions below

0
On BEST ANSWER

Well it turned out that my file was with extension .ts and not .tsx, so changing from .ts to .tsx solved problem.

1
On

Identify the difference between JSX and JS (brackets).

cell: ({ getValue }) => <div>{getValue()}</div>