Skip to content

Commit 59808d1

Browse files
committed
Set render prop of WithListContext as optional.
1 parent acea48f commit 59808d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/ra-core/src/controller/list/WithListContext.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export const WithListContext = <RecordType extends RaRecord>({
5757
return empty;
5858
}
5959

60-
return render(context) || children;
60+
if (render) {
61+
return render(context);
62+
}
63+
64+
return children;
6165
};
6266

6367
export interface WithListContextProps<RecordType extends RaRecord>
@@ -69,7 +73,7 @@ export interface WithListContextProps<RecordType extends RaRecord>
6973
>
7074
>
7175
> {
72-
render: (
76+
render?: (
7377
context: Partial<ListControllerResult<RecordType>>
7478
) => ReactElement | false | null;
7579
loading?: React.ReactNode;

0 commit comments

Comments
 (0)