Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react'
- var Child = React.createClass({
- getInitialState: function(){
- console.log('Child getInitialState');
- return { value: 'start'}
- },
- getDefaultProps: function(){
- console.log('Child getDefaultProps');
- },
- componentWillMount: function(){
- console.log('Child componentWillMount');
- },
- componentDidMount: function(){
- console.log('Child componentDidMount');
- },
- componentWillReceiveProps: function(){
- console.log('Child componentWillReceiveProps');
- },
- shouldComponentUpdate: function(){
- console.log('Child shouldComponentUpdate----true');
- return true
- // console.log('shouldComponentUpdate----false');
- // return false
- },
- componentWillUpdate: function() {
- console.log('Child componentWillUpdate');
- },
- componentDidUpdate: function() {
- console.log('Child componentDidUpdate');
- },
- componentWillUnmount: function() {
- console.log('Child componentWillUnmount');
- },
- render: function() {
- console.log('Child~~~~~~~~render~~~~~~~~');
- return (
- <h2>{this.props.text}</h2>
- );
- }
- });
- export default Child
Add Comment
Please, Sign In to add comment