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

225
Vistas
React-Window with MUI collapsible table rows

I looking for help sorting out problem I encountered recently while working with React-Window and MUI Collapsible Table Rows.

In general react-window render row for each of my item in the array, with some of the content hidden till we press arrow. When pressed, below our column appear new one with hidden content.

 function Row({ index, style }) {
   const [showList, toggleShowList] = useState(false);   
   
   return (
    <Fragment>
      <TableRow sx={style}>
         <TableCell>Visable Row:{index}</TableCell>
         <TableCell>
            <IconButton
                  aria-label="expand row"
                  size="small"
                  onClick={() => toggleShowList(!showList)}
                >
                  {showList ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
            </IconButton>
         </TableCell>
       </TableRow>
       <TableRow sx={{ style, display: showList ? "table-row" : "none" }}>
          <TableCell>hidden row:{index}</TableCell>
       </TableRow>
     </Fragment>
    );
  }

Above example is based on MUI Table component page. Problem arise when I passing it to React-Window as its display hidden content out of place.

I try to using useRef() for calculating Row Height but its has no effect on hidden element.

I open for suggestions and solutions. I created an example on code Sandbox with both how its actually work and how (it should) I want it to work.

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