score:0

  render() {
    return (
      <Router>
        <Switch>
          {!this.state.isUserAuthenticated ? (
            <React.Fragment>
              <Route exact path="/user/login">
                <LoginForm authenticateUser={this.authenticateUser} />
              </Route>
              <Route exact path="/user/register">
                <RegistrationForm />
              </Route>
              <Route
                render={() => <Redirect to={{ pathname: "/user/login" }} />}
              />
            </React.Fragment>
          ) : (
            <React.Fragment>
              <Route exact path="/projects">
                <Project />
              </Route>
              <Route
                render={() => <Redirect to={{ pathname: "/projects" }} />}
              />
            </React.Fragment>
          )}
        </Switch>
      </Router>
    );
  }

Related Query

More Query from same tag