Last active
February 10, 2016 00:17
-
-
Save fay-jai/5d70c14389c12af159bd to your computer and use it in GitHub Desktop.
This file contains 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
import React from "react"; | |
import { render } from "react-dom"; | |
const ParentComponent = React.createClass({ | |
getDefaultProps: function() { | |
console.log("Step 1 (invoked once) => GetDefaultProps"); | |
}, | |
getInitialState: function() { | |
console.log("Step 2 (invoked once) => GetInitialState"); | |
return { text: "" }; | |
}, | |
componentWillMount: function() { | |
console.log("Step 3 (invoked once) => ComponentWillMount"); | |
}, | |
render: function() { | |
console.log("Step 4 (invoked multiple times) => Render"); | |
return <div>I got rendered!</div>; | |
}, | |
componentDidMount: function() { | |
console.log("Step 5 (invoked once) => ComponentDidMount"); | |
}, | |
componentWillUnmount: function() { | |
console.log("Step 6 (invoked once) => ComponentWillUnmount"); | |
} | |
}); | |
render( | |
<ParentComponent />, | |
document.getElementById("root") | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment