Skip to content

Commit 6915841

Browse files
committed
remove defaultProps in DatagridBody
1 parent b2498da commit 6915841

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

packages/ra-ui-materialui/src/list/datagrid/DatagridBody.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const DatagridBody: FC<DatagridBodyProps> = React.forwardRef(
1313
{
1414
children,
1515
className,
16-
data,
16+
data = [],
1717
expand,
18-
hasBulkActions,
18+
hasBulkActions = false,
1919
hover,
2020
onToggleItem,
2121
resource,
22-
row,
22+
row = defaultChildren,
2323
rowClick,
2424
rowStyle,
2525
selectedIds,
@@ -61,6 +61,8 @@ const DatagridBody: FC<DatagridBodyProps> = React.forwardRef(
6161
)
6262
);
6363

64+
const defaultChildren = <DatagridRow />;
65+
6466
DatagridBody.propTypes = {
6567
className: PropTypes.string,
6668
children: PropTypes.node,
@@ -85,12 +87,6 @@ DatagridBody.propTypes = {
8587
isRowSelectable: PropTypes.func,
8688
};
8789

88-
DatagridBody.defaultProps = {
89-
data: [],
90-
hasBulkActions: false,
91-
row: <DatagridRow />,
92-
};
93-
9490
export interface DatagridBodyProps extends Omit<TableBodyProps, 'classes'> {
9591
className?: string;
9692
data?: any[];

0 commit comments

Comments
 (0)