react-snippets
rcjc
class componentName extends Component { render() { return ( <div> </div> ); } }
con
constructor(props) {
super(props);
}
方法
cwm→ componentWillMount method
cdm→ componentDidMount method
cwr→ componentWillReceiveProps method
scu→ shouldComponentUpdate method
cwup→ componentWillUpdate method
cdup→ componentDidUpdate method
cwun→ componentWillUnmount method
sst
this.setState('');
ssf
this.setState((state, props) => { return { }});
props
this.props
react 的生命周期: