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

246
Views
how to properly unmount and remount a modal (open / close ) React/js

I would like to explain my problem of the day

currently I use a modal works very well

so my problem and the next one

When I close my modal I correctly unmount the states,

logically i have an animation will have to be carried out during the closing, and the nothing, I have the impression that I disassemble my component too quickly

import React, { useState } from "react";

function Lead() {

const [isModalOpen, setModalOpen] = useState(false);

const handleDisplayModal = (value) => {
    setModalOpen(value);
};

return (
    <div>
        {isModalOpen && (
            <Modal
                onClose={() => handleDisplayModal(false)}
                isOpen={isModalOpen}
            />
        )}
        <Top
            setModalOpen={setModalOpen}
        />   
    </div>
);
}

export default Lead;

I am open to any proposal thank you very much.

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!