import { InfiniteList, useInfinitePaginationContext, Datagrid, TextField } from 'react-admin'; import { Box, Button } from '@mui/material'; const LoadMore = () => { const { hasNextPage, fetchNextPage, isFetchingNextPage, } = useInfinitePaginationContext(); return hasNextPage ? ( <Box mt={1} textAlign="center"> <Button disabled={isFetchingNextPage} onClick={() => fetchNextPage()} > Load more </Button> </Box> ) : null; }; export const BookList = () => ( <InfiniteList pagination={<LoadMore />}> <Datagrid> <TextField source="id" /> <TextField source="title" /> <TextField source="author" /> </Datagrid> </InfiniteList> );