Skip to content

Commit

Permalink
Refine TableProps type definition using Record<string, unknown> (#123)
Browse files Browse the repository at this point in the history
### What kind of change does this PR introduce?

This PR introduces a refinement in type definitions within the TableProps.
What is the current behavior?

Previously, the TableProps used a less precise type definition.

### What is the new behavior?

Now, TableProps uses Record<string, unknown> for a more accurate and robust type definition, enhancing the component's type safety.

### Does this PR introduce a breaking change?

No breaking changes are introduced.

### Other information:

The TableCellButton component remains unchanged as it was already optimally implemented.
  • Loading branch information
adl5423 committed Nov 28, 2023
1 parent 2be709c commit 03f78dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { UNDEFINED_WIDTH } from '../tableUtils';

import styles from './Table.module.scss';

type TableProps<T extends object> = {
type TableProps<T extends Record<string, unknown>> = {
data?: T[];
columns: ColumnDef<T>[];
emptyMessage?: string;
Expand All @@ -20,7 +20,7 @@ type TableProps<T extends object> = {
interactive?: boolean;
};

export const Table = <T extends object>({
export const Table = <T extends Record<string, unknown>>({
data = [],
columns,
emptyMessage,
Expand Down

0 comments on commit 03f78dd

Please sign in to comment.