Skip to content

Commit 46ba849

Browse files
authored
[material-ui][docs] Fix type error in virtualized table demo (#42852)
1 parent 93ae465 commit 46ba849

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/data/material/components/table/ReactVirtualizedTable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ const VirtuosoTableComponents = {
6464
Table: (props) => (
6565
<Table {...props} sx={{ borderCollapse: 'separate', tableLayout: 'fixed' }} />
6666
),
67-
TableHead,
68-
TableRow: ({ item: _item, ...props }) => <TableRow {...props} />,
67+
TableHead: React.forwardRef((props, ref) => <TableHead {...props} ref={ref} />),
68+
TableRow,
6969
TableBody: React.forwardRef((props, ref) => <TableBody {...props} ref={ref} />),
7070
};
7171

docs/data/material/components/table/ReactVirtualizedTable.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ const VirtuosoTableComponents: TableComponents<Data> = {
8989
Table: (props) => (
9090
<Table {...props} sx={{ borderCollapse: 'separate', tableLayout: 'fixed' }} />
9191
),
92-
TableHead,
93-
TableRow: ({ item: _item, ...props }) => <TableRow {...props} />,
92+
TableHead: React.forwardRef<HTMLTableSectionElement>((props, ref) => (
93+
<TableHead {...props} ref={ref} />
94+
)),
95+
TableRow,
9496
TableBody: React.forwardRef<HTMLTableSectionElement>((props, ref) => (
9597
<TableBody {...props} ref={ref} />
9698
)),

0 commit comments

Comments
 (0)