import React, { Component } from 'react'; import { Route, Redirect } from 'react-router-dom'; import Authenticate from './authenticate' type Props = { rest?: string; path:string; exact:boolean }; class PrivateRoute extends Component { render(){ let authenticate=new Authenticate(); return( authenticate.isAuthenticated ? ( this.props.children ) : ( ) } /> ) } } export default PrivateRoute;