我将代码设置如下。
componentWillUnmount() {
this.setState({'modal':false}) or this.setState({})
}
Run Code Online (Sandbox Code Playgroud)
但是状态尚不清楚。我怎样才能做到这一点?离开组件时需要清除状态。
| 归档时间: |
|
| 查看次数: |
10370 次 |
| 最近记录: |