score:0

{localStorage.getItem("loggedIn") && <Navigation/>}

score:1

import React, { Component } from 'react';
import { BrowserRouter , Route} from "react-router-dom";
import { PublicRoute, PrivateRoute } from './routes';
import './App.css';
import Home from "./components/Home";
import Menu from "./components/Menu";



class App extends Component { 
  render() {
    return (
     <BrowserRouter>
        <div>
          <PublicRoute />
          <PrivateRoute />
         </div>
     </BrowserRouter>
    );

} 
}
export default App;

Related Query

More Query from same tag