Created
June 24, 2020 17:05
-
-
Save evaldosantos/58df0df48d8c14b5b13059d3075b2216 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AuthenticatedHOC = Component => ({ isLoggedIn, ...otherProps }) => | |
isLoggedIn ? <Component {...otherProps}> : <Redirect to="/"> | |
// Component Dashboard | |
// ... | |
// | |
<Router> | |
<Route path="/dashboard" component={AuthenticatedHOC(Dashboard)} /> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment