-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
68 lines (51 loc) · 1.71 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
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import {createStore} from 'redux'
import myReducer from './reducers/index';
import { Provider } from 'react-redux';
const store = createStore(
myReducer,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);
// import Router from './zzz_Router';
// import Load from './zzz_Load';
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
);
registerServiceWorker();
// import React, {Component} from 'react';
// import ReactDOM from 'react-dom';
// const TodoInput = ({handleInput}) => <input type="text" onChange={handleInput} />
// const TodoAddButton = ({text, handleClick}) => <button onClick={handleClick}>{text}</button>
// const TodoList = ({todos}) => <ul>{todos.map((t,k) => <li key={k}>{t}</li>)}</ul>
// class App extends Component {
// constructor(props) {
// super(props)
// this.state = { todos: ['hello'] }
// this.onInputChanged = this.onInputChanged.bind(this);
// this.onButtonClicked = this.onButtonClicked.bind(this);
// }
// onInputChanged(e) {
// this.inputForm = e.target;
// this.newTodo = e.target.value;
// }
// onButtonClicked(e) {
// this.setState({ todos: this.state.todos.concat([this.newTodo]) });
// delete this.newTodo
// this.inputForm.value = ''
// }
// render() {
// return <div>
// <TodoInput handleInput={this.onInputChanged} />
// <TodoAddButton text="Add" handleClick={this.onButtonClicked} />
// <TodoList todos={this.state.todos} />
// </div>
// }
// }
// ReactDOM.render(<App />, document.getElementById('root'))