diff --git a/Lifecycle-chart.jpg b/Lifecycle-chart.jpg new file mode 100644 index 0000000..09d6b99 Binary files /dev/null and b/Lifecycle-chart.jpg differ diff --git a/README.md b/README.md index d481a85..6429f43 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ # React-Lifecycle-Cheatsheet -Short reference of React.Component lifecycle methods so I don't have to scroll through the huge text on the official documentation \ No newline at end of file +Short reference of React.Component lifecycle methods so I don't have to scroll through the huge text on the official documentation + +![Lifecycle Diagram](./Lifecycle-chart.jpg) + +## Mounting + +### constructor () + +``` +/** + * Create state and call super + * + * @param {object} props + */ +constructor (props) { + super(props); + this.state = { + foo: 'bar' + } +} +``` + +### static getDerivedStateFromProps () + +## Updating + +### shouldComponentUpdate () + +## Unmounting + +### componentWillUnmount () \ No newline at end of file