Why doesn't clearInterVal work?
滿天的星座
滿天的星座 2017-06-30 09:57:59
0
3
854

Using react to encapsulate a library that returns to the top.

滿天的星座
滿天的星座

reply all(3)
漂亮男人

Because every time you call goBack, a new timer will be opened

Peter_Zhu

A timer will be created when the first call returns. Another timer will be created when the timer call returns, and one will be closed at the same time. It seems that this process is always repeated, and there is always a timer. I don't understand what function you want to implement, but it will feel better if you take the code to create the timer outside the return method.

给我你的怀抱

Put setInterval(this.goBack,50) outside this.goBack and call it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template