import
React, {
Component }
from
'react';
import
logo
from
'./logo.svg';
import
'./App.css';
class
App
extends
Component {
state= {
text:
'',
i:
0,
}
componentDidMount() {
//this.timer = setInterval(this.tick.bind(this), 50); //或
this.
timer =
setInterval(()
=>
this.
textline(),
1000);
}
componentWillUnmount() {
clearInterval(
this.
timer);
}