Last active
May 23, 2020 10:23
-
-
Save TulshiDas39/f250812c244c66c3f044cda7acca3d3c to your computer and use it in GitHub Desktop.
Setting Not found Route in react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import './App.css'; | |
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom'; | |
import { PlaceAutoComplete } from './place/PlaceAutoComplete'; | |
import { FileUpload } from './fileUploadS3/FileUpload'; | |
import { NotFoound } from './htmlTest/Html'; | |
import { Navbar } from './navBar/Navbar'; | |
const App: React.FC = () => { | |
return ( | |
<BrowserRouter> | |
<Switch> | |
<Route exact path="/notfound" component={NotFoound} /> | |
<Route> | |
<div className="container"> | |
<Navbar /> | |
<Switch> | |
<Route exact path="/" component={PlaceAutoComplete} /> | |
<Route exact path="/about" component={FileUpload} /> | |
<Redirect to="/notfound"/> | |
</Switch> | |
</div> | |
</Route> | |
</Switch> | |
</BrowserRouter> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment