Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created September 14, 2022 12:10
Show Gist options
  • Save hieptl/6ff91570a01cf3c773f0112bb4405ee4 to your computer and use it in GitHub Desktop.
Save hieptl/6ff91570a01cf3c773f0112bb4405ee4 to your computer and use it in GitHub Desktop.
Instagram Clone React Node - PrivateRoute.js
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;
@hasanakmal1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment