Skip to content

Commit a450382

Browse files
committed
[TypeScript] Fix <SingleFieldList empty> does not accept text
1 parent 437af04 commit a450382

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/ra-ui-materialui/src/list/SingleFieldList.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ export const SingleFieldList = (inProps: SingleFieldListProps) => {
7777
}
7878

7979
if (data == null || data.length === 0 || total === 0) {
80-
if (empty) {
81-
return empty;
82-
}
83-
84-
return null;
80+
return empty ?? null;
8581
}
8682

8783
return (
@@ -135,7 +131,7 @@ export const SingleFieldList = (inProps: SingleFieldListProps) => {
135131
export interface SingleFieldListProps<RecordType extends RaRecord = any>
136132
extends StackProps {
137133
className?: string;
138-
empty?: React.ReactElement;
134+
empty?: React.ReactNode;
139135
linkType?: string | false;
140136
children?: React.ReactNode;
141137
// can be injected when using the component without context

0 commit comments

Comments
 (0)