Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created November 4, 2018 16:07
Show Gist options
  • Save amandeepmittal/9a7dd92a9379050ebd6084258c47f2cb to your computer and use it in GitHub Desktop.
Save amandeepmittal/9a7dd92a9379050ebd6084258c47f2cb to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { Route, Switch } from 'react-router-dom';
import Navbar from './components/Navbar';
import Home from './components/Home';
import PrivateRoutes from './components/auth/PrivateRoutes';
import Signin from './components/auth/Signin';
import Profile from './components/user/Profile';
import Signup from './components/user/Signup';
class Routes extends Component {
render() {
return (
<div>
<Navbar />
<Switch>
<Route exact path="/" component={Home} />
<PrivateRoutes path="/user/edit/:userId" />
<Route path="/user/:userId" component={Profile} />
<Route path="/signup" component={Signup} />
<Route path="/signin" component={Signin} />
</Switch>
</div>
);
}
}
export default Routes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment