📜  不渲染的时间秒更新 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:59.890000             🧑  作者: Mango

代码示例1
componentDidMount() {
    this.intervalID = setInterval(
      () => this.tick(),
      1000
    );
  }
  componentWillUnmount() {
    clearInterval(this.intervalID);
  }