muningis / react-router-private-route

Too lazy to rewrite it all the time, so here it is - simple private route(might or might not be based on https://reacttraining.com/react-router/web/example/auth-workflow)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Router Private Route

Example

<Router>
  <div>
    <PrivateRoute path="/" auth={Math.random() > Math.random()} redirect={"/login"} component={loadable(() => import("./pages/home"))} />
    <Route exact path="/login" component={loadable(() => import("./pages/login"))} />
  </div>
</Router>

Readme is heavily W.I.P. ...

About

Too lazy to rewrite it all the time, so here it is - simple private route(might or might not be based on https://reacttraining.com/react-router/web/example/auth-workflow)

License:MIT License


Languages

Language:JavaScript 100.0%