marmelab/react-admin · warning
The Pagination limit prop is deprecated. Empty state should
Error message
The Pagination limit prop is deprecated. Empty state should be handled by the component displaying data (Datagrid, SimpleList).
What it means
The Pagination component's limit prop is deprecated. Previously it rendered a toolbar placeholder when the list was empty; now empty states are the responsibility of the list component (Datagrid, SimpleList), so passing limit while the page is empty/invalid triggers a development-mode deprecation warning and renders null.
Source
Thrown at packages/ra-ui-materialui/src/list/pagination/Pagination.tsx:113
actions: {
...slotProps?.actions,
nextButton: {
disabled: !hasNextPage,
...slotProps?.actions?.nextButton,
},
},
}),
[slotProps, hasNextPage]
);
if (isPending) {
return <Toolbar variant="dense" />;
}
// Avoid rendering TablePagination if "page" value is invalid
if (total === 0 || page < 1 || (total != null && page > totalPages!)) {
if (limit != null && process.env.NODE_ENV === 'development') {
console.warn(
'The Pagination limit prop is deprecated. Empty state should be handled by the component displaying data (Datagrid, SimpleList).'
);
}
return null;
}
if (isSmall) {
return (
<TablePagination
count={total == null ? -1 : total}
rowsPerPage={perPage}
page={page - 1}
onPageChange={handlePageChange}
rowsPerPageOptions={emptyArray}
component="span"
labelDisplayedRows={labelDisplayedRows}
slotProps={slotProps}
{...sanitizeListRestProps(rest)}View on GitHub (pinned to 051f511bb0)
Solutions
- Remove the limit prop from <Pagination> or the pagination props in <List pagination={...}>.
- Let Datagrid/SimpleList render the empty state (customize via their empty prop if needed).
- Update custom pagination wrappers to the current Pagination API.
Example fix
// before
<Pagination limit={25} rowsPerPageOptions={[10, 25]} />
// after
<Pagination rowsPerPageOptions={[10, 25]} />
// empty state: <Datagrid empty={<CustomEmpty />} /> Defensive patterns
Strategy: validation
Validate before calling
const { limit, ...rest } = paginationProps;
if ('limit' in paginationProps) console.warn('Pagination limit prop is deprecated; use the list component empty state instead.'); Prevention
- Strip deprecated pagination props (limit) when upgrading react-admin.
- Handle empty lists via Datagrid/SimpleList empty props.
- Run the app in development during upgrades to catch deprecation warnings early.
When it happens
Trigger: Rendering <Pagination limit={...} /> (or rowsPerPage including limit) in a List while total is 0 or the page is out of range, in development mode.
Common situations: Custom List pagination config copied from older react-admin codebases (pre-4.x where limit/empty-state handling changed); filtered lists returning zero rows surfacing the deprecated prop.
Related errors
- Found getManyReference result in cache without total or page
- The X-Total-Count header is missing in the HTTP Response. Th
- The X-Total-Count header is invalid in the HTTP Response.
- The ${countHeader} header is missing in the HTTP Response. T
- ra.navigation.page_out_of_boundaries
AI-assisted analysis of marmelab/react-admin@051f511bb0 (2026-08-30).
Data as JSON: /api/errors/3559cbda5a5fb865.
Report an issue: GitHub.