{"record":{"id":"3559cbda5a5fb865","repo":"marmelab/react-admin","slug":"the-pagination-limit-prop-is-deprecated-empty-sta","errorCode":null,"errorMessage":"The Pagination limit prop is deprecated. Empty state should be handled by the component displaying data (Datagrid, SimpleList).","messagePattern":"The Pagination limit prop is deprecated\\. Empty state should be handled by the component displaying data \\(Datagrid, SimpleList\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/ra-ui-materialui/src/list/pagination/Pagination.tsx","lineNumber":113,"sourceCode":"            actions: {\n                ...slotProps?.actions,\n                nextButton: {\n                    disabled: !hasNextPage,\n                    ...slotProps?.actions?.nextButton,\n                },\n            },\n        }),\n        [slotProps, hasNextPage]\n    );\n\n    if (isPending) {\n        return <Toolbar variant=\"dense\" />;\n    }\n\n    // Avoid rendering TablePagination if \"page\" value is invalid\n    if (total === 0 || page < 1 || (total != null && page > totalPages!)) {\n        if (limit != null && process.env.NODE_ENV === 'development') {\n            console.warn(\n                'The Pagination limit prop is deprecated. Empty state should be handled by the component displaying data (Datagrid, SimpleList).'\n            );\n        }\n        return null;\n    }\n\n    if (isSmall) {\n        return (\n            <TablePagination\n                count={total == null ? -1 : total}\n                rowsPerPage={perPage}\n                page={page - 1}\n                onPageChange={handlePageChange}\n                rowsPerPageOptions={emptyArray}\n                component=\"span\"\n                labelDisplayedRows={labelDisplayedRows}\n                slotProps={slotProps}\n                {...sanitizeListRestProps(rest)}","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/ra-ui-materialui/src/list/pagination/Pagination.tsx#L95-L131","documentation":"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.","triggerScenarios":"Rendering <Pagination limit={...} /> (or rowsPerPage including limit) in a List while total is 0 or the page is out of range, in development mode.","commonSituations":"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.","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."],"exampleFix":"// before\n<Pagination limit={25} rowsPerPageOptions={[10, 25]} />\n// after\n<Pagination rowsPerPageOptions={[10, 25]} />\n// empty state: <Datagrid empty={<CustomEmpty />} />","handlingStrategy":"validation","validationCode":"const { limit, ...rest } = paginationProps;\nif ('limit' in paginationProps) console.warn('Pagination limit prop is deprecated; use the list component empty state instead.');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["deprecation","pagination","lists"],"backgroundTag":"deprecated-prop","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}