From 7a88821ab47eed8674fcbc268254bed72fc657f0 Mon Sep 17 00:00:00 2001 From: ChuYang <45116321+ChuYang-FE@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:14:27 +0800 Subject: [PATCH] docs: update translation and fix format issue --- src/content/learn/separating-events-from-effects.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/learn/separating-events-from-effects.md b/src/content/learn/separating-events-from-effects.md index f6b0515ee3..5c372e9ad6 100644 --- a/src/content/learn/separating-events-from-effects.md +++ b/src/content/learn/separating-events-from-effects.md @@ -899,7 +899,7 @@ function Timer() { setCount(count + 1); }); - useTimer(onTick, 1000); // 🔴 Avoid: 传递 Effect Event + useTimer(onTick, 1000); // 🔴 避免: 传递 Effect Event return

{count}

} @@ -912,7 +912,7 @@ function useTimer(callback, delay) { return () => { clearInterval(id); }; - }, [delay, callback]); // 需要在依赖项中指定“callback” + }, [delay, callback]); // 需要在依赖项中指定 “callback” } ``` @@ -934,7 +934,7 @@ function useTimer(callback, delay) { useEffect(() => { const id = setInterval(() => { - onTick(); // ✅ Good: 只在 Effect 内部局部调用 + onTick(); // ✅ 好: 只在 Effect 内部局部调用 }, delay); return () => { clearInterval(id);