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

223
Views
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
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!