Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MathieuLorber/b9b257d306ef72bbd930cd609c7daa3f to your computer and use it in GitHub Desktop.
Save MathieuLorber/b9b257d306ef72bbd930cd609c7daa3f to your computer and use it in GitHub Desktop.
Auth with React Router v4
<Switch>
<Route path={Routes.LOGIN} component={LoginRoute}/>
<Route path={Routes.ROOT} render={props => <AuthenticatedRoute>
<Route path={Routes.WHATEVER} component={Whatever}/>
</AuthenticatedRoute>}/>
</Switch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment