From 530f22c77e69c12c66268ce233b29f55da650485 Mon Sep 17 00:00:00 2001 From: Francesco Esposito <33671357+frsposito@users.noreply.github.com> Date: Wed, 31 Jul 2019 16:01:12 +0200 Subject: [PATCH] improvement: edit PrivateRoutes --- src/PrivateRoute.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PrivateRoute.js b/src/PrivateRoute.js index f89108e..8285b3a 100644 --- a/src/PrivateRoute.js +++ b/src/PrivateRoute.js @@ -1,15 +1,15 @@ import React from "react"; import { Redirect, Route } from "react-router-dom"; -import { isLogin } from "./utils/auth"; - export const PrivateRoute = ({ component: Component, ...rest }) => { return ( - isLogin() ? : - } + render={props => ( + localStorage.getItem('user') + ? + : + )} /> ); };