Created
February 7, 2017 21:57
-
-
Save didierfranc/3543f75ebdfc56e5ee4fbc08d8579744 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Async from 'react-code-splitting' | |
import Login from './Login' | |
import Signup from './Signup' | |
import Header from './Header' | |
const Home = () => <Async load={import('./Home')} /> | |
const App = ({ user }) => ( | |
<Body> | |
<Header /> | |
{user.loggedIn ? <Route path="/" component={Home} /> : <Redirect to="/login" />} | |
<Route path="/signup" component={Signup} /> | |
<Route path="/login" component={Login} /> | |
</Body> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment