Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PrivateRoute ({component: Component, authed, ...rest}) {
- return (
- <Route
- {...rest}
- render={(props) => authed === true
- ? <Component {...props} />
- : <Redirect to={{pathname: '/login', state: {from: props.location}}}/>}
- />
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement