Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paulodutra/5eb378b82f55c4be457ab6fc2a72f562 to your computer and use it in GitHub Desktop.
Save paulodutra/5eb378b82f55c4be457ab6fc2a72f562 to your computer and use it in GitHub Desktop.
exemplo-de-definicao-de-rotas-em-appjs-para-apresentacao-das-animacoes
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