Skip to content

Instantly share code, notes, and snippets.

@alejovdev
Last active November 26, 2019 02:43
Show Gist options
  • Save alejovdev/226cfe58c3a0769dce9293c621149e5b to your computer and use it in GitHub Desktop.
Save alejovdev/226cfe58c3a0769dce9293c621149e5b to your computer and use it in GitHub Desktop.
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