Created
December 5, 2019 18:11
-
-
Save paulodutra/5eb378b82f55c4be457ab6fc2a72f562 to your computer and use it in GitHub Desktop.
exemplo-de-definicao-de-rotas-em-appjs-para-apresentacao-das-animacoes
This file contains hidden or 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 { | |
BrowserRouter as Router, | |
Switch, | |
Route | |
} from 'react-router-dom'; | |
import Home from './components/Home'; | |
import ErrorServer from './components/ErrorServer'; | |
import NotFound from './components/NotFound'; | |
export default function App(props) { | |
return ( | |
<div> | |
<Router> | |
<Switch> | |
<Route exact path="/" render={props => <Home {...props} />} /> | |
<Route exact path="/404" render={props => <NotFound {...props} />} /> | |
<Route exact path="/500" render={props => <ErrorServer {...props} />} /> | |
</Switch> | |
</Router> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment