摘要:
let timer;const Index = () => { const [count2, setCount2] = useState(0) useEffect(() => { timer && clearInterval(timer); return () => timer && clearIn 阅读全文
摘要:
const Index = () => { const [count, setCount] = useState(60) useEffect(() => { setTimeout(() => { if (count > 0) { console.log(count); setCount(count 阅读全文