Skip to content

Commit 95d2008

Browse files
committed
Keep a ListIterator export, even though RecordsIterator doesn't handle loading, offline, empty and error states.
1 parent aacef95 commit 95d2008

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const RecordsIterator = <RecordType extends RaRecord = any>(
1919
total === 0
2020
) {
2121
console.warn(
22-
'<RecordsIterator> does not handle loading, empty and error states. Use <WithListContext>.'
22+
'<RecordsIterator> does not handle loading, offline, empty and error states. Use <WithListContext>.'
2323
);
2424
return null;
2525
}
@@ -47,3 +47,12 @@ export interface RecordsIteratorProps<RecordType extends RaRecord = any>
4747
children?: React.ReactNode;
4848
render?: (record: RecordType, index: number) => React.ReactNode;
4949
}
50+
51+
/**
52+
* @deprecated use RecordsIterator instead.
53+
*/
54+
export const ListIterator = RecordsIterator;
55+
/**
56+
* @deprecated use RecordsIteratorProps instead.
57+
*/
58+
export type ListIteratorProps = RecordsIteratorProps;

packages/ra-core/src/controller/list/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export * from './ListController';
88
export * from './ListFilterContext';
99
export * from './ListPaginationContext';
1010
export * from './ListSortContext';
11-
export * from './RecordsIterator';
1211
export * from './queryReducer';
12+
export * from './RecordsIterator';
1313
export * from './useExpanded';
1414
export * from './useFilterContext';
1515
export * from './useInfiniteListController';

0 commit comments

Comments
 (0)