Inflearn brand logo image

Inflearn Community Q&A

jay0's profile image
jay0

asked

Learning React while making web games

4-2. Check the response speed by inserting setTimeout

this.timeout

Written on

·

269

0

react

Answer 1

0

jay0님의 프로필 이미지
jay0
Questioner

안녕하세요 제로초님!...

setTimeout을 onClickScreen 바깥에다가 쓰고 실행하면,

첫번째 waiting  -> ready -> now는 문제가 없는데

두번째 waiting -> ready에서 now로 넘어가지 않습니다.

clearTimeout이 this.timeout을 영구적으로 지워버린 것 같은데, onClickScreen안에 있을 때는 렌더링할 때마다 setTimeout이 다시 생성되고 밖에 있을 때는 다시 생성되지 못하기 때문이라고 이해하면 될까요?~

jay0's profile image
jay0

asked

Ask a question