-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsx
81 lines (75 loc) · 1.9 KB
/
index.jsx
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
import fakeReact, { render, Component } from './reactFAKE';
// jsx build theo cái mà mình import
class Title extends Component {
componentDidMount() {
console.log('title');
console.log(document.getElementById('title'));
}
render() {
// console.log("AAA" , console.log())
return (
<h1 id="title">{this.props.children}</h1>
);
}
}
const B = () => {
return (
<h1>Nguyen Dinh Nguyen</h1>
)
}
class Test extends Component{
componentDidMount(){
console.log("compontent did mount")
}
render(){
return (
<p> cashuasvc</p>
)
}
}
class App extends Component {
constructor(props) {
super(props);
this.state = {counter: 213};
this.onIncrease = this.onIncrease.bind(this);
this.onDecrease = this.onDecrease.bind(this);
}
componentDidMount() {
}
// static getDerivedStateFromProps(state , props) {
// return true
// }
getSnapshotBeforeUpdate(a, b) {
console.log("cahsciahscaisuh")
console.log(a,b)
return true
}
onIncrease() {
this.setState({counter: this.state.counter + 1});
}
onDecrease() {
this.setState({counter: this.state.counter - 1});
}
render() {
const {counter} = this.state;
return (
<div>
<Title>HAAHAAAAA</Title>
<h1>nguyen minh duc</h1>
<Test />
<B />
<p>
<button onClick={this.onDecrease}>-</button>
{' '}Counter: {counter}{' '}
<button onClick={this.onIncrease}>+</button>
</p>
</div>
);
}
}
// write code full class ,
//
// console.log(window.c)
const A = <h1>cascas</h1>
console.log(<App />)
render(<App/>, document.getElementById('root'));