raoenhui / raoenhui.github.io

前端妹子的博客blog
https://raoenhui.github.io
46 stars 3 forks source link

关于《REACT HOOKS与SETINTERVAL》的提问 #39

Closed andyyxw closed 1 year ago

andyyxw commented 4 years ago
Snipaste_2020-04-28_20-59-59

这里使用letconst有区别吗,是刻意的吗?

andyyxw commented 4 years ago
Snipaste_2020-04-28_21-00-27

为什么useEffect中没有clearInterval呢?

raoenhui commented 4 years ago
Snipaste_2020-04-28_20-59-59

这里使用letconst有区别吗,是刻意的吗?

不是刻意的,可以用const

raoenhui commented 4 years ago
Snipaste_2020-04-28_21-00-27

为什么useEffect中没有clearInterval呢?

这里是需要加clearInterval

raoenhui commented 4 years ago

谢谢你的问题,以上已更新到blog,期待新的问题