Skip to content

Commit

Permalink
Rest props are not safe
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 committed Nov 22, 2024
1 parent 1a8b24e commit 70b6c9c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ export interface DataGridProps<R, SR = unknown, K extends Key = Key> extends Sha
rowClass?: Maybe<(row: NoInfer<R>, rowIdx: number) => Maybe<string>>;
/** @default 'ltr' */
direction?: Maybe<Direction>;
[data: `data-${string}`]: unknown;
'data-testid'?: Maybe<string>;
'data-cy'?: Maybe<string>;
}

/**
Expand Down Expand Up @@ -264,7 +265,8 @@ function DataGrid<R, SR, K extends Key>(
'aria-description': ariaDescription,
'aria-describedby': ariaDescribedBy,
'aria-rowcount': rawAriaRowCount,
...dataProps
'data-testid': testId,
'data-cy': dataCy
} = props;

/**
Expand Down Expand Up @@ -1080,7 +1082,6 @@ function DataGrid<R, SR, K extends Key>(
return (
// biome-ignore lint/a11y/useValidAriaProps: aria-description is a valid prop
<div
{...dataProps}
role={role}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
Expand Down Expand Up @@ -1122,6 +1123,8 @@ function DataGrid<R, SR, K extends Key>(
ref={gridRef}
onScroll={handleScroll}
onKeyDown={handleKeyDown}
data-testid={testId}
data-cy={dataCy}
>
<DataGridDefaultRenderersProvider value={defaultGridComponents}>
<HeaderRowSelectionChangeProvider value={selectHeaderRowLatest}>
Expand Down

0 comments on commit 70b6c9c

Please sign in to comment.