Last active
          September 13, 2017 17:54 
        
      - 
      
- 
        Save courtneyphillips/0940f4f1ecec15e4bb2827969200d0e2 to your computer and use it in GitHub Desktop. 
    peanut butter jellyyyyy 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class PeanutButterJelly extends React.Component { | |
| constructor(props){ | |
| super(props); | |
| this.state = { | |
| dummyStateToTriggerUpdate: [] | |
| }; | |
| this.addToDummyState = this.addToDummyState.bind(this); | |
| setTimeout(() => | |
| this.addToDummyState(), | |
| 5000 | |
| ); | |
| console.log("1."); | |
| } | |
| componentWillMount(){ | |
| console.log("2. "); | |
| } | |
| render(){ | |
| return (<div>{this.props.placeholderProp}</div>); | |
| } | |
| componentDidMount(){ | |
| console.log("3. "); | |
| } | |
| componentWillReceiveProps(){ | |
| console.log("4. ") | |
| } | |
| shouldComponentUpdate(){ | |
| console.log("5. "); | |
| return true; | |
| } | |
| componentWillUpdate(){ | |
| console.log("6. "); | |
| } | |
| componentDidUpdate(){ | |
| console.log("7. "); | |
| } | |
| componentWillUnmount(){ | |
| console.log("8. "); | |
| } | |
| addToDummyState(){ | |
| this.setState({dummyStateToTriggerUpdate: "bleh"}); | |
| } | |
| } | |
| export default PeanutButterJelly; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class App extends React.Component { | |
| constructor(props){ | |
| super(props); | |
| this.state = { | |
| dummyStateToPassAsPropToChild: [] | |
| }; | |
| this.updateDummyStateToTriggerMethodInChild = this.updateDummyStateToTriggerMethodInChild.bind(this); | |
| } | |
| updateDummyStateToTriggerMethodInChild(){ | |
| this.setState({dummyStateToPassAsPropToChild: "WOW ANOTHER NEW PROP"}); | |
| } | |
| componentDidMount(){ | |
| setTimeout(() => | |
| this.updateDummyStateToTriggerMethodInChild(), | |
| 3000 | |
| ); | |
| } | |
| render() { | |
| return ( | |
| <div> | |
| <PeanutButterjelly placeholderProp="hey"/> | |
| </div> | |
| ); | |
| } | |
| } | |
| export default App; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment