Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created April 8, 2020 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/0dadde9559bdb8a08c3e1b991700ed40 to your computer and use it in GitHub Desktop.
Save Porter97/0dadde9559bdb8a08c3e1b991700ed40 to your computer and use it in GitHub Desktop.
#...
import AuthedRoute from './AuthedRoute';
import UnauthedRoute from './UnauthedRoute';
#...
class AppRouter extends Component {
#...
render() {
return (
#...
<Switch>
<Route exact path="/" component={() => <Home currentUser={this.props.currentUser} />} />
<UnauthedRoute path="/register" component={Register} />
<UnauthedRoute path="/login" component={Login} />
<AuthedRoute path="/settings" component={Settings} />
<AuthedRoute path="/@:username" component={Profile} />
</Switch>
#...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment