Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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