Skip to content

Commit 94d66df

Browse files
erwanMarmelabMadeorsk
authored andcommitted
fix BC
1 parent 5999871 commit 94d66df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ export const WithListContext = <RecordType extends RaRecord>({
2828
const context = useListContext<RecordType>();
2929
const { data, total, isPending, error } = context;
3030

31-
if (isPending === true) {
32-
return loading ? loading : null;
31+
if (isPending === true && loading) {
32+
return loading;
3333
}
3434

35-
if (error) {
36-
return errorElement ? errorElement : null;
35+
if (error && errorElement) {
36+
return errorElement;
3737
}
3838

39-
if (data == null || data.length === 0 || total === 0) {
40-
return empty ? empty : null;
39+
if ((data == null || data.length === 0 || total === 0) && empty) {
40+
return empty;
4141
}
4242

4343
return render(context) || null;

0 commit comments

Comments
 (0)