Skip to content

Instantly share code, notes, and snippets.

@dance2die dance2die/App.js

Created Dec 19, 2018
What would you like to do?
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import "./styles.css";
const Main = () => <h1>Main!</h1>;
const Elsewhere = () => <h1>Elsewhere!</h1>;
function App() {
return (
<Link to="/">Main</Link>
<Link to="/else">Else</Link>
<Route path="/" exact component={Main} />
<Route path="/else/" component={Elsewhere} />
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.