Answers for "react how to change class on body"

0

add classnames to body

openModal = (event) => {
  document.body.classList.add('modal-open');
  this.setState({ showModal: true });
}
hideModal = (event) => {
  document.body.classList.remove('modal-open');
  this.setState({ showModal: false });
}
Posted by: Guest on February-14-2020

Code answers related to "react how to change class on body"

Code answers related to "Javascript"

Browse Popular Code Answers by Language