Skip to content

Instantly share code, notes, and snippets.

@reciosonny
Last active September 18, 2018 15:25
Show Gist options
  • Save reciosonny/99afd62c411dec411d7b4cb2fba07943 to your computer and use it in GitHub Desktop.
Save reciosonny/99afd62c411dec411d7b4cb2fba07943 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
// import axios from 'axios';
import AnotherComponent from './AnotherComponent';
import Todo from './Todo';
import ParentComponent from './ParentComponent';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
val: "Click me to change me"
}
console.log("constructor executed");
}
componentDidMount = () => {
console.log("componentDidMount() executed");
}
static getDerivedStateFromProps(nextProps, prevState) {
console.log("getDerivedStateFromProps() executed");
}
render() {
console.log("component rendered..");
return (
<div>
<h2>
<AnotherComponent />
<Todo />
</h2>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment