Skip to content

Instantly share code, notes, and snippets.

@Ibro
Last active January 11, 2018 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ibro/5b80595ab3414b34c90caba580b1c34b to your computer and use it in GitHub Desktop.
Save Ibro/5b80595ab3414b34c90caba580b1c34b 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/
import React from 'react';
import './App.css';
import { BrowserRouter as Router, Route } from 'react-router-dom';
const Home = () => <h1>Home</h1>;
const App = () => (
<div className="App">
<header className="App-header">
<Router>
<Route path="/" component={Home} />
</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