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

454
Views
React Material UI Drawer — Sliding Transition not working

I have written a drawer for my react app

const Sidebar = () => {
    return (
      <Drawer
        open={burgerModalOpen}
        onClose={() => setBurgerModalOpen(false)}
      >
        <Box>
          <Navigator />
        </Box>
      </Drawer>
    );
  };
const [burgerModalOpen, setBurgerModalOpen] = React.useState(false);
return (
      <>
        <MobileSideBarContainer>
          <BurgerIconContainer onClick={_handleOpenMobileBurger}>
            <div>
              <BurgerIcon />
            </div>
          </BurgerIconContainer>
          <Sidebar />
        </MobileSideBarContainer>
      </>
    );
  }

The drawer just 'appears' and 'disappears' ... it's not sliding in like it does here

How do I fix this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The sidebar returns the drawer object. Most likely on every new render there is a new drawer object created. Due to which there is some issue regarding refs internally. Can you try using a variable -

const drawer = (
    <Drawer open={burgerModalOpen} onClose={() => setBurgerModalOpen(false)}>
      <Box>
        <Navigator />
      </Box>
    </Drawer>
  );

const Sidebar = () => {
    return drawer;
  };
about 4 years ago · Juan Pablo Isaza Report
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!