I created app that redirects user to login page, and if he logged in than he can access other routs of the site that are defined in Home component. The problem is I cannot now add NotFound route. Here is my code
<BrowserRouter basename="/">
<main>
<Switch>
<Route exact path="/login"
render={(props) => <Login {...props} setLoggedIn={() => this.setLoggedIn()}/>}/>
<Route path="/" render={(props) => (
this.state.isAdminLogin ? (
<Home {...props} />
) : (
<Redirect to="/login"/>
)
)}/>
<Route component={NotFound} />
</Switch>
</main>
</BrowserRouter>
When i open not existing route it still shows home page...