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

131
Vistas
How to display created components one at a time in the same surface?

I'll try to explain my problem as much clear as possible !

I'm developing a website using React and Material-UI. In one of my page, i got a surface (here a component from MUI). In this Paper i want to display some component i've developed but i want to display only one at a time.

I have implemented a component from MUI to use the page number as a reference for which component to display.

Imagine something like this:

<Paper>
  <Grid container>
     <Grid item>
         <OWN COMPONENTS>
     </Grid>
  </Grid>
  <Grid item>
     <Stack>
        <Pagination count={nbPage} color='primary' onChange={handleChange} />
     </Stack>
  </Grid>
</Paper>

From this skeleton, i would like to display OWNCOMPONENT_1 if the pageNumber is 1, OWNCOMPONENT_2 if pageNumber is 2, etc.

I didn't find any example from Pagination MUI component displaying components but only list. I've tried to use a switch function that return the component needed but the visual result was broken. I also tried with a routing solution but i don't master this enough to do something that works.

I expect all i said is understandable and i'm open for any solution even if i have to change the way to render what i want.

I still be a novice using React and JS aswell, so i'll probably need explainations :)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can set the page number on change to state and display component based on that state. I have added a solution in Sandbox: https://codesandbox.io/s/basicpagination-material-demo-forked-5q78eq?file=/demo.tsx

about 4 years ago · Juan Pablo Isaza Denunciar
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