# life cycle methods ```javascript= import React from "react"; import "./styles.css"; class App extends React.Component { constructor(props) { super(props); this.state = { name: "" }; console.log("1. constructor - Mounting"); } static getDerivedStateFromProps(props, state) { return {// give in return name: props.name }; } componentDidMount() { console.log("3. Didmount - Mounting"); } render() { console.log("2. render - Mounting"); return <div>{this.state.name}</div>; } } export default App; ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up