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

97
Visualizações
avoiding multiple modals on page

I have a page where I have a grid of elements that need buttons to request or show more data that won't fit on the page and I don't want the page to change.

I would like the modal template in their own component, not to clutter up the parent. Doing this, I have been forced to put a button to open the modal in the modal component which then gets put into the parent. This causes many unused modals to be in memory.

How can I have lots of buttons on the page that create modals without having the modal in memory ready for a show/hide.

Ideally, I'd like a component I can just feed props to so it knows what to display and I can open/close it with the proper visuals and interactable components (input box, buttons, etc).

I am trying to avoid using a third party dependency, as I have found a few modal specific npm packages, I don't think this is complicated enough to need a dependency. The way I have been creating modals though doesn't work when I have a lot of buttons that spawn modals on the same page.

about 4 years ago · Juan Pablo Isaza
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