Last active
January 4, 2017 15:33
-
-
Save kuy/d9beb6fb97269e39ee61bca4be546edf to your computer and use it in GitHub Desktop.
This file contains 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
// Borrowed from react-router exmample "Auth Flow" | |
// https://github.com/ReactTraining/react-router/tree/master/examples/auth-flow | |
render(( | |
<Router history={withExampleBasename(browserHistory, __dirname)}> | |
<Route path="/" component={App}> | |
<Route path="login" component={Login} /> | |
<Route path="logout" component={Logout} /> | |
<Route path="admin" onEnter={requireAuth}> // Route hook | |
<Route path="about" component={About} onEnter={...} /> // Component hook | |
<Route path="dashboard" component={Dashboard} /> | |
</Route> | |
</Route> | |
</Router> | |
), document.getElementById('example')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment