react shortcut cheat sheets code example
Example 1: react cheat sheets
render() {
return <div />;
}
Example 2: react cheat sheets
constructor(props) {
super(props);
this.state = {
list: props.initialList
};
}
// where props aren't used in constructor
constructor() {
super();
this.state = {
list: []
};
}
Example 3: react cheat sheets
componentWillMount() {
// invoked once.
// fires before initial 'render'
}