daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Oct 21st, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from "react";
  2. import {
  3.   Route,
  4.   NavLink,
  5.   HashRouter
  6. } from "react-router-dom";
  7. import Home from "./Home";
  8. import Stuff from "./Stuff";
  9. import Contact from "./Contact";
  10.  
  11.  
  12. class Main extends Component {
  13.   render() {
  14.     return (
  15.     <HashRouter>
  16.         <div>
  17.         <h1>Simple SPA</h1>
  18.         <ul className="header">
  19.             <li><NavLink exact to="/">Home</NavLink></li>
  20.             <li><NavLink to="/stuff">Stuff</NavLink></li>
  21.             <li><NavLink to="/contact">Contact</NavLink></li>
  22.         </ul>
  23.  
  24.  
  25.         <div className="content">
  26.             <Route exact path="/" component={Home}/>
  27.             <Route path="/stuff" component={Stuff}/>
  28.             <Route path="/contact" component={Contact}/>
  29.         </div>
  30.         </div>
  31.     </HashRouter>
  32.     );
  33.   }
  34. }
  35.  
  36. export default Main;
  37.    
  38. import React, { Component } from "react";
  39.  
  40. class Login extends Component {
  41.     render() {
  42.  
  43.     return (
  44.         <div>
  45.             <form>
  46.                 <label>
  47.                     Name:
  48.                 <input type="text" name="name" />
  49.                 </label>
  50.                 <input type="submit" value="Submit" />
  51.             </form>
  52.         </div>
  53.     );
  54.     }
  55. }
  56.  
  57. export default Login;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top