title: auto redirect from "/" path to "/login" or "/admin"
body: <p>I need to make an automatic redirection when the app starts at "localhost:3000/". that means to make a redirect from "/" to "/login" or "/admin" automatically.</p>
  
  <p>i tried to make this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>imports ...... 
  
  class App extends react component {
  
  state = {isAuth:false}
  
  
  func = () =&gt; {
  //axios function that goes to node.js to pass json-web-token and receive payload.
  if success: this setState({isAuth:true})
  
  }
  
  render () {
  
  if (!isAuth) return &lt;Redirect to="/login"&gt;
  
  if (isAuth) return &lt;Redirect to="/admin"&gt;
  
  
  return (
        &lt;Router&gt;
         {this.func()}
          &lt;div className="App"&gt;
            &lt;div className="container"&gt;
              &lt;Route exact path="/addNewVacation" component= 
                {VacationAdder} /&gt;
              &lt;Route path="/admin" component={Admin} /&gt;
              &lt;Route path="/home" component={Home} /&gt;
              &lt;Route exact path="/register" component={Register} /&gt;
              &lt;Route exact path="/login" component={Login} /&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/Router&gt;
      );
  
  
  }
  
  
  }</code></pre>
  </div>
  </div>
  </p>