title: Uncaught TypeError: Cannot read property 'props' of null
body: <ul>
  <li>I have a react code</li>
  <li>this code renders various panels in the UI.</li>
  <li>when I click a tag, this function is called sportsCornerPanel()</li>
  <li>but I am getting the Uncaught TypeError how to fix it</li>
  <li>providing snippet code below.</li>
  <li>whole code you can see it in the fiddle</li>
  </ul>
  
  <p><strong>code snippet</strong></p>
  
  <pre><code>    sportsCornerPanel() {
          debugger;
  
          console.log("sportsCornerPanel"
          console.log("this.props.sportsPanelState.size--&gt;" + this.props);
  
          if (this.props.sportsPanelState.size === 'hidden') {
  
              if (!this.props.sportsPanelState.visible) {
                  this.props.dispatch(sportsOpenPanel());
              } else {
                  this.props.dispatch(sportsClosePanel());
              }
          }
      }
  
  
      render() {
  
  
          let sportsContent, leftNavLink;
  
          if (this.props.sports-layout !== 'small') {
              console.log("SportsBox---page loads at bigger size");
              console.log("SportsBox---page loads at ipad size");
              sportsContent = &lt;SportsBox className="sports-header"/&gt;;
          } else {
              if (this.props.sportsPanelState.visible) {
                  console.log("sportsPanelState--when it becomes small--around ipad width");
  
                  sportsContent = &lt;SportsBox className="sports-nav"/&gt;;
                  leftNavLink = &lt;a onClick={this.sportsCornerPanel} href="javascript:;" className="header-navLink active"&gt;&lt;/a&gt;;
              } else {
                  if (this.props.sports.active) {
  
                      console.log("SportsBox");
  
                      sportsContent = &lt;SportsBox className="sports-nav"/&gt;;
                  } else {
  
                      console.log("leftNavLink--when it becomes small--around ipad width");
  
                      leftNavLink = &lt;a onClick={this.sportsCornerPanel} href="javascript:;" className="header-navLink"&gt;&lt;/a&gt;;
                  }
              }
          }
  
  
  output
  
  Uncaught TypeError: Cannot read property 'props' of null
  </code></pre>