Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import React from 'react';
  2. import { render } from 'react-dom';
  3. import {Router,Route,Link,hashHistory} from 'react-router'
  4. import Hello from './Hello';
  5.  
  6. const Home =()=> <div><h1>home</h1><Links/></div>;
  7. const About =()=> <div><h1>About</h1><Links/></div>;
  8. const Contact =()=> <div><h1>Contact</h1><Links/></div>
  9.  
  10. const Links =()=>
  11. <nav>
  12. <Link to='/'>Home</Link>
  13. <Link to='/about'>About</Link>
  14. <Link to='/contact'>Contact</Link>
  15. </nav>
  16.  
  17. const App = () => (
  18. <Router history ={hashHistory}>
  19. <Route path="/" component ={Home}></Route>
  20. <Route path="/about" component ={About}></Route>
  21. <Route path="/contact" component ={Contact}></Route>
  22.  
  23. </Router>
  24. );
  25.  
  26. render(
  27.  
  28.  
  29.  
  30. <App />
  31.  
  32. , document.getElementById('root'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement