Skip to content

Commit

Permalink
fix: handle null rendering in BaseDataTable cell (#321)
Browse files Browse the repository at this point in the history
* fix: handle null rendering in BaseDataTable cell

Signed-off-by: ya zhou <[email protected]>

* refactor: remove unused styled-components import in DataTable

Signed-off-by: ya zhou <[email protected]>

* ci: update version

Signed-off-by: ya zhou <[email protected]>

---------

Signed-off-by: ya zhou <[email protected]>
  • Loading branch information
yazhouio authored Dec 10, 2024
1 parent 27c7d12 commit fc5f10b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .changeset/wise-garlics-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@kubed/code-editor': patch
'@kubed/diff-viewer': patch
'@kubed/components': patch
'@kubed/log-viewer': patch
'@kubed/charts': patch
'@kubed/hooks': patch
'@kubed/icons': patch
'@kubed/tests': patch
'kubed-documents': patch
---

fix: handle null rendering in BaseDataTable cell
2 changes: 1 addition & 1 deletion packages/components/src/Table/DataTable/BaseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function BaseDataTable<T>({ table }: BaseDataTableProps<T>) {
{...(getTdProps && getTdProps(table, cell.getContext()))}
{...(cell.column.columnDef.meta?.td ?? {})}
>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
{flexRender(cell.column.columnDef.cell, cell.getContext()) ?? null}
</BaseTable.TableCell>
))}
</BaseTable.TableRow>
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/Table/DataTable/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Header, Row, RowData, Table, TableState } from '@tanstack/react-table';
import cx from 'classnames';
import * as React from 'react';
import styled from 'styled-components';
import * as BaseTable from '../BaseTable';
import { BaseDataTable } from './BaseTable';
import { Pagination, TableFooter } from './Pagination';
Expand Down

0 comments on commit fc5f10b

Please sign in to comment.