title: How to go to another page onClick in react
body: <p>I'm new to react and i'm trying to load another page when user clicks a button. I have used window.location but nothing happens when i click the button. How to fix this?</p>
  
  <p>This where i have included my onClick </p>
  
  <pre><code>&lt;div&gt;
    &lt;img className="menu_icons" src={myhome}/&gt;
    &lt;label className="menu_items" onClick={home}&gt;Home&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Function written for onClick</p>
  
  <pre><code>function home(e) {
      e.preventDefault();
      window.location = 'my-app/src/Containers/HomePage.jsx';
  }
  </code></pre>