Skip to content

Commit

Permalink
fix(ui): convert cell values to string for rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
leopuleo authored and Pavel910 committed Jun 19, 2024
1 parent 97234a8 commit 44eadc5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/ui/src/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ const defineColumns = <T,>(
if (cell && typeof cell === "function") {
return cell(info.row.original);
} else {
return info.getValue() || null;
// Automatically convert any cell value to a string for rendering,
// ensuring the table displays values correctly. This aligns with React's
// rendering, which expects JSX, strings or null.
// https://github.com/TanStack/table/issues/1042
return info.getValue() ? String(info.getValue()) : null;
}
},
enableSorting,
Expand Down

0 comments on commit 44eadc5

Please sign in to comment.