Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. function PrivateRoute ({component: Component, authed, ...rest}) {
  2. return (
  3. <Route
  4. {...rest}
  5. render={(props) => authed === true
  6. ? <Component {...props} />
  7. : <Redirect to={{pathname: '/login', state: {from: props.location}}}/>}
  8. />
  9. )
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement