I added bootstrap v5.0 to my react app by inserting the bootstrap Scripts directly to the index.html, so now i can't access the bootstrap methods.
HandleLogIn = () => {
const loginForm = document.querySelector('#login-form');
loginForm.addEventListener('submit', (e) => {
e.preventDefault();
const email = loginForm['inputEmail-login'].value;
const password = loginForm['inputPassword-login'].value;
this.auth
.signInWithEmailAndPassword(email, password)
.then((res) => {
console.log('You are Logged In');
})
.catch((err) => {
console.log(err.code);
});
let modal = document.querySelector('#modal-logIn');
let newModal = bootstrap.Modal.getInstance(modal);
newModal.hide();`enter code here`
loginForm.reset();
});
};
react will say bootstrap is not defined The hide() method will not work as well.