-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathReactComponent.js
More file actions
50 lines (29 loc) · 892 Bytes
/
ReactComponent.js
File metadata and controls
50 lines (29 loc) · 892 Bytes
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
import React from 'react';
class ReactComponent extends React.Component {
static contextTypes = {}; // Only needed when using context!
static propTypes = {};
static defaultProps = {};
state = {
foo: 'foo'
};
// React lifecycle methods in order of occurrence
componentWillMount() {
// Add event listeners (Store, WebSocket, document, etc.)
}
componentDidMount() {
// Use of refs (this.refs.foo)
}
componentWillReceiveProps() {}
shouldComponentUpdate() {}
componentWillUpdate() {}
componentDidUpdate() {}
componentWillUnmount() {
// Remove event listeners (Store, WebSocket, document, etc.)
}
// clickHandlers/eventHandlers
_handleClickSubmit() {}
_handleChangeDescription() {}
// Render method always comes last
render() {}
}
export default ReactComponent;