Created
September 14, 2022 12:10
-
-
Save hieptl/6ff91570a01cf3c773f0112bb4405ee4 to your computer and use it in GitHub Desktop.
Instagram Clone React Node - PrivateRoute.js
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
import React from 'react'; | |
import { Route, Redirect } from 'react-router-dom'; | |
const PrivateRoute = ({component: Component, ...rest}) => { | |
return ( | |
<Route {...rest} render={props => ( | |
localStorage.getItem('auth') ? | |
<Component {...props} /> | |
: <Redirect to="/login" /> | |
)} /> | |
); | |
}; | |
export default PrivateRoute; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Nulls Brawl 2025 game's core mechanics revolve around trophy progression, character upgrades, and team-based tactical gameplay, challenging players to master intricate map dynamics, perfect their character skills, and outmaneuver opponents in pulse-pounding multiplayer battles that demand quick thinking and precise execution