Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda