import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import {Switch,Route,BrowserRouter} from'react-router-dom';
import Sobre from'./Sobre';
serviceWorker.unregister();
ReactDOM.render(
<BrowserRouter>
<Switch>
<Route path='/' component={App}/>
<Route path="/sobre" component={Sobre}/>
{/* <Route path='/livro' exact={true} component={Livro}> </Route>
<Route path='/autores' exact={true} component={Autores}> </Route>
<Route component={NotFound}> </Route> */}
</Switch>
</BrowserRouter>
, document.getElementById('root'))
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
import React from 'react';
const Header = () =>{
return (
<nav>
<div className="nav-wrapper indigo lighten-2">
<a href="/" className="brand-logo ml-3">Casa do Código</a>
<ul id="nav-mobile" className="right">
<li><a href="/autores">Autores</a></li>
<li><a href='/livros'>Livros</a></li>
<li><a href="/sobre">Sobre</a></li>
</ul>
</div>
</nav>
);
}
export default Header;
meu componente sobre nao renderiza, ao clicar no link volta para pagina principal