Last active
November 26, 2019 02:43
-
-
Save alejovdev/226cfe58c3a0769dce9293c621149e5b to your computer and use it in GitHub Desktop.
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, { useState, useEffect } from "react"; | |
import { BrowserRouter, Switch, Route, Link } from "react-router-dom"; | |
function Config({}) { | |
return ( | |
<div className="config"> | |
<h1>Config</h1> | |
<Link to="/">Todos</Link> | |
</div> | |
); | |
} | |
function Todos({}) { | |
return ( | |
<div className="todos"> | |
<h1>Todos</h1> | |
<Link to="/config">Config</Link> | |
</div> | |
); | |
} | |
function App({}) { | |
return ( | |
<div className="app"> | |
<BrowserRouter> | |
<Switch> | |
<Route path="/config" render={props => <Config {...props} />} /> | |
<Route path="/" render={props => <Todos {...props} />} /> | |
</Switch> | |
</BrowserRouter> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment