title: React Routing Redirect onClick
body: <p>Ive been trying to do a simple redirect to another component on button click, but for some reason it doesnt work.I want to redirect to '/dashboard' and display AdminServices from login as follows: </p>
  
  <p>//index.js</p>
  
  <pre><code>ReactDOM.render(&lt;BrowserRouter&gt;&lt;App /&gt;&lt;/BrowserRouter&gt;, 
      document.getElementById("root"));
  </code></pre>
  
  <p>//App.js</p>
  
  <pre><code>     &lt;Switch&gt;
            &lt;Route path="/" component={Login} /&gt;
            &lt;Route path="/dashboard" component={AdminServices} /&gt;
          &lt;/Switch&gt;
  </code></pre>
  
  <p>//Login.js</p>
  
  <pre><code>&lt;Button
  onClick={this.login}
  &gt;
  &lt;/Button&gt;
  
  login = () =&gt;{
      &lt;Redirect to="/dashboard" /&gt;
    }
  </code></pre>
  
  <p>//AdminServices.js</p>
  
  <pre><code>render(){
          return(
              &lt;div&gt;Test&lt;/div&gt;
          );
      }
  </code></pre>