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

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