Skip to content

Commit 57f2b0c

Browse files
committed
review
1 parent 65fafa2 commit 57f2b0c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ export const Datagrid: React.ForwardRefExoticComponent<
236236
* the Datagrid displays the empty component.
237237
*/
238238
if (data == null || data.length === 0 || total === 0) {
239-
return empty ?? <ListNoResults resource={resource} />;
239+
return empty === undefined ? (
240+
<ListNoResults resource={resource} />
241+
) : (
242+
empty
243+
);
240244
}
241245

242246
/**

packages/ra-ui-materialui/src/list/datatable/DataTable.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,13 @@ export const DataTable = React.forwardRef(function DataTable<
182182
{...props}
183183
hasBulkActions={hasBulkActions}
184184
loading={loading}
185-
empty={empty ?? <ListNoResults resource={resourceFromContext} />}
185+
empty={
186+
empty === undefined ? (
187+
<ListNoResults resource={resourceFromContext} />
188+
) : (
189+
empty
190+
)
191+
}
186192
>
187193
<DataTableRowSxContext.Provider value={rowSx}>
188194
<DataTableRoot

0 commit comments

Comments
 (0)