Skip to content

Commit

Permalink
Exclude width from DOM props.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Oct 12, 2023
1 parent 58b2dd5 commit 4d74836
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-basics",
"version": "0.102.0",
"version": "0.103.0",
"description": "Everyday components for React",
"license": "MIT",
"repository": {
Expand Down
16 changes: 10 additions & 6 deletions src/components/table/GridTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export interface GridTableProps extends CommonProps {
export function GridTable(props: GridTableProps) {
const { data, className, style, children, cardMode, ...domProps } = props;

const gridTemplateColumns = mapChildren(children, ({ props }) => {
return props.hidden ? '' : props.width ?? defaultWidth;
})
.join(' ')
.trim();

if (cardMode) {
return (
<div className={classNames(styles.cards, className)}>
Expand All @@ -33,6 +27,8 @@ export function GridTable(props: GridTableProps) {
hidden,
label,
alignment = 'start',
// eslint-disable-next-line @typescript-eslint/no-unused-vars
width,
...domProps
} = child.props;

Expand All @@ -59,6 +55,12 @@ export function GridTable(props: GridTableProps) {
);
}

const gridTemplateColumns = mapChildren(children, ({ props }) => {
return props.hidden ? '' : props.width ?? defaultWidth;
})
.join(' ')
.trim();

return (
<table
{...domProps}
Expand Down Expand Up @@ -95,6 +97,8 @@ export function GridTable(props: GridTableProps) {
className,
hidden,
alignment = 'start',
// eslint-disable-next-line @typescript-eslint/no-unused-vars
width,
...domProps
} = child.props;

Expand Down

0 comments on commit 4d74836

Please sign in to comment.