Skip to content

Instantly share code, notes, and snippets.

@didierfranc
Created February 7, 2017 21:57
Show Gist options
  • Save didierfranc/3543f75ebdfc56e5ee4fbc08d8579744 to your computer and use it in GitHub Desktop.
Save didierfranc/3543f75ebdfc56e5ee4fbc08d8579744 to your computer and use it in GitHub Desktop.
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