Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

244
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda