Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import React, { Component } from "react";
  2. import {
  3. Route,
  4. NavLink,
  5. HashRouter
  6. } from "react-router-dom";
  7. import Home from "./home.js";
  8. import Australia from "./australia.js";
  9. import Turkey from "./turkey.js";
  10. import About from "./about.js";
  11.  
  12.  
  13.  
  14. class Main extends Component {
  15. render() {
  16. return (
  17. <HashRouter>
  18. <div>
  19. <h1 className="title">Fetching Data API</h1>
  20. <ul className="header">
  21. <li><NavLink exact to="/">Home</NavLink></li>
  22. <li><NavLink to="/australia">Australia</NavLink></li>
  23. <li><NavLink to="/turkey">Turkey</NavLink></li>
  24. <li><NavLink to="/about">About</NavLink></li>
  25.  
  26. </ul>
  27. <div className="content">
  28. <Route exact path="/" component={Home}/>
  29. <Route exact path="/australia" component={Australia}/>
  30. <Route exact path="/turkey" component={Turkey}/>
  31. <Route exact path="/about" component={About}/>
  32. </div>
  33. </div>
  34. </HashRouter>
  35. );
  36. }
  37. }
  38.  
  39. export default Main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement