title: Anchor tag isn't calling the onClick function in React
body: <p>I'm trying to update my component state when you click on an anchor tag inside the render method. I've tried binding inside the constructor, but still the console.log isn't being called. Below is my code. Please help. This is holding me back from progressing lol.</p>
  
  <p>This is modified code based on my previous question here on stackoverflow.</p>
  
  <pre><code>const React = require('react');
  
  
  class Navbar extends React.Component {
    constructor(...props) {
      super(...props);
      this.setActiveTab = this.setActiveTab.bind(this)
      this.state = {
        currentPage: "/"
      }
    }
  
    setActiveTab(e) {
      console.log(e.target)
      this.setState({
        currentPage: e.target.href 
      })
    }
  
    render() {
      const { path } = this.props
      let classString = path === this.state.currentPage ? 'nav-item is-tab is-active' : 'nav-item is-tab'
  
      return (
        &lt;nav className="nav"&gt;
  
          &lt;div className="nav-left"&gt;
            &lt;a className="nav-item"&gt;
              &lt;h1&gt;CREATORS NEVER DIE&lt;/h1&gt;
            &lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div className="nav-right nav-menu"&gt;
            &lt;a href="/" className={classString} onClick={this.setActiveTab}&gt;
              Home
            &lt;/a&gt;
          &lt;/div&gt;
  
  
        &lt;/nav&gt;
      )
    }
  }
  
  module.exports = Navbar;
  </code></pre>