import React from 'react' import ReactDOM from 'react-dom' import Child from './Child' var LifeCycle = React.createClass({ getInitialState: function(){ console.log('Parent getInitialState'); return { value: 'start'} }, getDefaultProps: function(){ console.log('Parent getDefaultProps'); }, componentWillMount: function(){ console.log('Parent componentWillMount'); }, componentDidMount: function(){ console.log('Parent componentDidMount'); }, componentWillReceiveProps: function(){ console.log('Parent componentWillReceiveProps'); }, shouldComponentUpdate: function(){ console.log('Parent shouldComponentUpdate----true'); return true // console.log('shouldComponentUpdate----false'); // return false }, componentWillUpdate: function() { console.log('Parent componentWillUpdate'); }, componentDidUpdate: function() { console.log('Parent componentDidUpdate'); }, componentWillUnmount: function() { console.log('componentWillUnmount'); }, handleClick: function(event){ console.log('Parent~~~~~~~~setSdate~~~~~~~~'); this.setState({value: event.target.value}, function(){ console.log('Parent~~~~~~~~this.setState callback~~~~~~~~') }) }, handleForceUpdate: function(event){ console.log('Parent~~~~~~~~forceUpdate~~~~~~~~'); this.forceUpdate(function(){ console.log('Parent~~~~~~~~forceUpdate callback~~~~~~~~'); }) }, handleUnmount: function(event){ console.log('Parent~~~~~~~~Unmount~~~~~~~~'); ReactDOM.unmountComponentAtNode(document.getElementById('root')); }, render: function() { console.log('Parent~~~~~~~~render~~~~~~~~'); return (