title: Hide menu and redirect when clicking on react-router Link
body: <p>For the menu of my site I am using links. When clicked on menu hamburger icon a hover over menu appears which is a checkbox. Now I want to hide the menu after i click a Link  and go to another page. But the menu doesnt close, the page behind the menu changes which is good. I setup a function which changes the checkbox state to false but it doesn't hide the menu when a Link is clicked.</p>
  
  <pre><code>constructor(props) {
    super(props);
    this.state = {
      hamburger: false
    };
    this.turnOff= this.turnOff.bind(this);
  }
  
  turnOff = (e) =&gt; {
      this.setState({hamburger:false});
  }
  </code></pre>
  
  <p>in render()  i have:</p>
  
  <pre><code>&lt;input name="hamburger" type="checkbox" id="menuToggle" onChange={this.handleChange} checked={this.state.hamburger} className="menu-toggle-input"&gt;&lt;/input&gt;
  &lt;Link to="/about" onClick={this.turnOff}&gt;About&lt;/Link&gt;
  </code></pre>
  
  <p>When i click on link it loads the page on the background but the menu does not close and i get an error in console:</p>
  
  <blockquote>
    <p>Can't perform a React state update on an unmounted component.</p>
  </blockquote>