Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda