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

  1. Remove the limit prop from <Pagination> or the pagination props in <List pagination={...}>.
  2. Let Datagrid/SimpleList render the empty state (customize via their empty prop if needed).
  3. 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

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


AI-assisted analysis of marmelab/react-admin@051f511bb0 (2026-08-30). Data as JSON: /api/errors/3559cbda5a5fb865. Report an issue: GitHub.