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

154
Views
Close menu from the outside without triggering a rerender
<div>
   <div onClick={()={closeMenu()}}>
       <Dashboard />
   </div>
       <Navbar />
</div>

I have an app where on the navbar I have a clickable button than when clicked displays a menu. I had to also make it so when I click any part of the page, the menu hides so I used states at the top of the tree. Problem is that any time I open or close the menu, it forces a re render (I think?) since the state is at the top. How can I approach this to avoid re renders? Usememo in this case wouldn't work since the boolean/state will always change and will trigger a re render unless I'm missing something?

about 4 years ago · Santiago Gelvez
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!