-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
84 lines (80 loc) · 1.68 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React from 'react'
import ReactDOM from 'react-dom'
import App from './js/App'
import registerServiceWorker from './registerServiceWorker'
ReactDOM.render(<App/>, document.getElementById('root'))
registerServiceWorker()
// import React, { Component } from 'react';
// import ReactDOM from 'react-dom';
// // import { Router, Route, Link, Switch } from 'react-router';
// import {
// HashRouter,
// Route,
// Link,
// Switch
// } from 'react-router-dom';
//
// class App extends Component {
// render() {
// return (
// <div>
// <h1>App</h1>
// <ul>
// <li><Link to="/">Home</Link></li>
// <li><Link to="/about">About</Link></li>
// <li><Link to="/inbox">Inbox</Link></li>
// </ul>
// {this.props.children}
//
// </div>
// );
// }
// }
//
// const About = () => (
// <div>
// <h3>About</h3>
// </div>
// )
//
// const Home = () => (
// <div>
// <h3>Home</h3>
// </div>
// )
//
// const Message = ({ match }) => (
// <div>
// <h3>new messages</h3>
// <h3>{match.params.id}</h3>
// </div>
// )
//
// class ABC extends Component {
// render() {
// console.log(this.props.match.params.id)
// return <div style={{backgroundColor: 'red'}}>
// 11111111
// </div>
// }
// }
//
// const Inbox = ({ match }) => (
// <div>
// <h2>Topics</h2>
// <Route path={`${match.url}/messages/:id`} component={ABC}/>
//
// </div>
// )
//
// ReactDOM.render(
// (<HashRouter>
// <App>
// <Route exact path="/" component={Home} />
// <Route path="/about" component={About} />
// <Route path="/inbox" component={Inbox} />
// <Route path="/messages/:id" component={ABC}/>
// </App>
// </HashRouter>),
// document.getElementById('root')
// );