Guest User

Untitled

a guest
Aug 25th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. import React from 'react'
  2.  
  3. var Child = React.createClass({
  4. getInitialState: function(){
  5. console.log('Child getInitialState');
  6. return { value: 'start'}
  7. },
  8.  
  9. getDefaultProps: function(){
  10. console.log('Child getDefaultProps');
  11. },
  12.  
  13. componentWillMount: function(){
  14. console.log('Child componentWillMount');
  15. },
  16.  
  17. componentDidMount: function(){
  18. console.log('Child componentDidMount');
  19. },
  20.  
  21. componentWillReceiveProps: function(){
  22. console.log('Child componentWillReceiveProps');
  23. },
  24.  
  25. shouldComponentUpdate: function(){
  26. console.log('Child shouldComponentUpdate----true');
  27. return true
  28.  
  29. // console.log('shouldComponentUpdate----false');
  30. // return false
  31. },
  32.  
  33. componentWillUpdate: function() {
  34. console.log('Child componentWillUpdate');
  35. },
  36.  
  37.  
  38. componentDidUpdate: function() {
  39. console.log('Child componentDidUpdate');
  40. },
  41.  
  42. componentWillUnmount: function() {
  43. console.log('Child componentWillUnmount');
  44. },
  45.  
  46. render: function() {
  47. console.log('Child~~~~~~~~render~~~~~~~~');
  48. return (
  49. <h2>{this.props.text}</h2>
  50. );
  51. }
  52.  
  53. });
  54.  
  55. export default Child
Add Comment
Please, Sign In to add comment