Created
November 17, 2017 13:22
-
-
Save alexbeletsky/bc9329dd6c3179820ea0c8b43bb1422e 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
const CheckedWelcome = composeComponents( | |
Welcome, | |
[ | |
(c) => checkBoarded(c, { withValue: true, redirectTo: '/app/dashboard' }), | |
(c) => requiresAuth(c) | |
] | |
); | |
const CheckApp = composeComponents( | |
App, | |
[ | |
(c) => checkBoarded(c, { withValue: false, redirectTo: '/welcome-on-board'}), | |
(c) => requiresAuth(c), | |
(c) => requiresSmth(c, { options: {} }) | |
] | |
); | |
const routes = ( | |
<Route path=""> | |
// much more clean route definition | |
<Route path="/welcome-on-board" component={CheckedWelcome} /> | |
<Route path="/app" component={CheckedApp}> | |
// ... | |
</Route> | |
</Route> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment