console
class LiftCircle extends React.Component {
constructor(){
this.state = {
msg:'hello , this is a message!'
}
}
componentDidMount(){
console.log('componentDidMount');
}
componentDidUpdate(){
console.log('componentDidUpdate');
}
render(){
const { msg } = this.state;
return (
<div>
{msg}
<p>
<button onClick={
() => { this.setState({ msg: 'change msg' }) }
}>btn1111</button>
</p>
</div>
)
}
};
ReactDOM.render(<LiftCircle />, document.getElementById('root'));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=">
<meta http-equiv="X-UA-Compatible" content="">
<title></title>
</head>
<body>
<div id='root'></div>
</body>
</html>