this.fn() 是啥意思

react官网实例:

class Timer extends React.component{
    //构造函数
    constructor(props) {
        super : (props);
        this.state = {//这里面的this.state就是指在这里调用,this就是调用的意思
            seconds : 0
        }
    };
    //一个累加
    tick(){
        this.setState((state,props)=>{
            seconds: this.state.seconds + 1
        })
    };//这里的箭头函数,返回的是一个对象,那么函数体要用()括起来,语法冲突。
    tick(){
        this.setState((state,props)=>({
            seconds: this.state.seconds + 1
        }))
    };
    //不停渲染
    componentDidMount(){
        setInterval(()=>{this.tick()},1000);//this.tick()就是在这里调用一次的意思
    }
    //渲染到虚拟DOM
    render() {
        return <div>seconds : {this.state.seconds}</div>;
    };
}
export default Timer;
ReactDOM.render(<Timer />,document.getElementById("root"));