摘要: let timer;const Index = () => { const [count2, setCount2] = useState(0) useEffect(() => { timer && clearInterval(timer); return () => timer && clearIn 阅读全文
posted @ 2021-11-24 11:33 Edison~~ 阅读(325) 评论(0) 推荐(0) 编辑
摘要: const Index = () => { const [count, setCount] = useState(60) useEffect(() => { setTimeout(() => { if (count > 0) { console.log(count); setCount(count 阅读全文
posted @ 2021-11-24 11:12 Edison~~ 阅读(378) 评论(0) 推荐(0) 编辑