Skip to content

Commit 7a88821

Browse files
authored
docs: update translation and fix format issue
1 parent 4d16e06 commit 7a88821

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/learn/separating-events-from-effects.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ function Timer() {
899899
setCount(count + 1);
900900
});
901901

902-
useTimer(onTick, 1000); // 🔴 Avoid: 传递 Effect Event
902+
useTimer(onTick, 1000); // 🔴 避免: 传递 Effect Event
903903

904904
return <h1>{count}</h1>
905905
}
@@ -912,7 +912,7 @@ function useTimer(callback, delay) {
912912
return () => {
913913
clearInterval(id);
914914
};
915-
}, [delay, callback]); // 需要在依赖项中指定“callback”
915+
}, [delay, callback]); // 需要在依赖项中指定 “callback”
916916
}
917917
```
918918
@@ -934,7 +934,7 @@ function useTimer(callback, delay) {
934934

935935
useEffect(() => {
936936
const id = setInterval(() => {
937-
onTick(); //Good: 只在 Effect 内部局部调用
937+
onTick(); //: 只在 Effect 内部局部调用
938938
}, delay);
939939
return () => {
940940
clearInterval(id);

0 commit comments

Comments
 (0)