Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
MUI Grid Pro's pagination state is not updated when clicking on the next page

So I have a MUI grid inside a React component that I'm using and have my own custom pagination in the footer of the table. I use the Grid's context API to see the current page and use the setPage method that is provided by the API.

export const Pagination = ({
                               page,
                           }) => {
    const apiRef = useGridApiContext();
    const api = apiRef.current;

    useGridApiEventHandler(apiRef, 'pageChange', (pageNum: number) => {
        // run stuff when the page is changed
    });


    return (
        <Box display="flex" marginTop={2}>
            <ButtonGroup>
                <Button
                    variant="text"
                    aria-label="Previous"
                    onClick={() => api.setPage(page - 1)}
                    size="small"
                >
                </Button>
            </ButtonGroup>
            <ButtonGroup>
                <Button
                    variant="text"
                    aria-label="Next"
                    onClick={() => api.setPage(page + 1)}
                    size="small"
                >
                </Button>
            </ButtonGroup>
        </Box>
    );
};

The onClick handler runs fine, but the Grid's internal state is not changed or affected. It doesn't seem like a MUI grid problem. Does anyone have an idea?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!