Last active
January 11, 2018 20:09
-
-
Save Ibro/bba2473baeedb051adf7216811db5f53 to your computer and use it in GitHub Desktop.
Using React Router v4 with create-react-app - https://codingblast.com/react-router-create-react-app/
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 from 'react'; | |
import './App.css'; | |
import { BrowserRouter as Router, Route } from 'react-router-dom'; | |
const Home = () => <h1>Home</h1>; | |
const Admin = () => <h1>Admin</h1>; | |
const App = () => ( | |
<div className="App"> | |
<header className="App-header"> | |
<Router> | |
<div> | |
<Route path="/" component={Home} /> | |
<Route path="/admin" component={Admin} /> | |
</div> | |
</Router> | |
</header> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. | |
</p> | |
</div> | |
); | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment