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

114
Vistas
Close Bootstrap modal using jQuery in React application

I am trying to use Bootstrap modal inside React. I have successfully opened a modal. For closing the modal programatically, I am using the below code.

$('#exampleModal').modal('hide')

The code is written inside the onClick event of a button. When I click the button, I am getting the error Unhandled Rejection (TypeError): jquery__WEBPACK_IMPORTED_MODULE_6___default(...)(...).modal is not a function

I have imported Bootstrap and jQuery as below.

import 'bootstrap';
import $ from 'jquery'; 

How to fix this? How can I use jQuery inside React to close the modal?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use react-bootstrap and try to avoid JQuery while working with React. Because JQuery is at a bit different level than React internals, if I can put it this way.

In this example you can see how it can be handled within component state to show modal: https://react-bootstrap.github.io/components/modal/#modals-live

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