title: addClass and removeClass react
body: <p>I want to check that the target element contains a class or not. if not add the class and if yes then remove the class.</p>
  
  <pre><code>class Hello extends React.component{
    addActiveClass(e){
       if(e.target.classList.contains("active")){
           //I wanna to add active class to e.target
       }else{
           //I wanna to remove active class from e.target
           //I wanna to do something like e.target.classList.removeClass("atcive");
       }
    }
  
    render() {
         &lt;div className="red green blue" onClick={this.addActiveClass}&gt;Hello World&lt;/div&gt;
         &lt;div className="red green blue" onClick={this.addActiveClass}&gt;Good Bye World&lt;/div&gt;
  
    }
  }
  </code></pre>
  
  <p><strong>I wanna to add and remove class to only target element not the other elements.</strong></p>