import React from 'react'; import { Redirect, Route } from "react-router-dom"; export const PrivateRoute = ({ component: Component, ...rest }) => ( (localStorage.getItem("token") !==null) ? ( ) : ( ) } /> )