Return to Snippet

Revision: 70678
at June 8, 2016 00:22 by dylansong


Initial Code
import React from 'react';
import { Router, Route, Link, browserHistory } from 'react-router';

const Home = () => <div><h1>Home</h1><Links /></div>;
const About = () => <div><h1>About</h1><Links /></div>;
const Contact = () => <div><h1>Contact</h1><Links /></div>;
const Links = () =>
    <nav>
      <Link to="/02-hash-vs-browserHistory">Home</Link>
      <Link to="/02-hash-vs-browserHistory/about">About</Link>
      <Link to="/02-hash-vs-browserHistory/contact">Contact</Link>
    </nav>

const App = () => {
  return (
    <Router history={ browserHistory }>
      <Route path="02-hash-vs-browserHistory" component={Home}></Route>
      <Route path="02-hash-vs-browserHistory/about" component={About}></Route>
      <Route path="02-hash-vs-browserHistory/contact" component={Contact}></Route>
    </Router>
  )
};

export default App;

Initial URL


Initial Description


Initial Title
2.hash history vs browser history

Initial Tags


Initial Language
Other