diff --git a/project/p3/src/App.js b/project/p3/src/App.js index 8c2947961..0cc32ddfb 100644 --- a/project/p3/src/App.js +++ b/project/p3/src/App.js @@ -17,9 +17,11 @@ class App extends React.Component{ }] } } + // 官方不建议使用 UNSAFE_componentWillMount(){ console.log('UNSAFE_componentWillMount'); } + // 官方不建议使用 UNSAFE_componentWillReceiveProps(newProps){ console.log(newProps); } @@ -45,7 +47,9 @@ class App extends React.Component{ } changeShow(){ - this.setState({bShow:!this.state.bShow}) + this.setState({bShow:!this.state.bShow},()=>{ + console.log(this.state.bShow) + }) } render(){ //dangerouslySetInnerHTML