Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { render } from 'react-dom';
- import {Router,Route,Link,hashHistory} from 'react-router'
- import Hello from './Hello';
- 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='/'>Home</Link>
- <Link to='/about'>About</Link>
- <Link to='/contact'>Contact</Link>
- </nav>
- const App = () => (
- <Router history ={hashHistory}>
- <Route path="/" component ={Home}></Route>
- <Route path="/about" component ={About}></Route>
- <Route path="/contact" component ={Contact}></Route>
- </Router>
- );
- render(
- <App />
- , document.getElementById('root'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement