Skip to content

Commit

Permalink
Add missing index number
Browse files Browse the repository at this point in the history
  • Loading branch information
giser authored Dec 7, 2024
1 parent 714b2e5 commit cf6f6f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/learn/removing-effect-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -2333,4 +2333,4 @@ label, button { display: block; margin-bottom: 5px; }
</Challenges>
**译注**:
<a name="note1"></a> 在创建 `onTick` 函数时,由于闭包的缘故,`setCount(count + increment)` 捕获的是创建时 `count``increment` 值。由于这里的“说谎”,每次重新渲染时新创建的 `onTick` 函数不能替换掉 Effect 里旧 `onTick` 函数,于是最终的效果就是 `setCount(0 + 1)` <br/>
<a name="note1"></a> [1] 在创建 `onTick` 函数时,由于闭包的缘故,`setCount(count + increment)` 捕获的是创建时 `count``increment` 值。由于这里的“说谎”,每次重新渲染时新创建的 `onTick` 函数不能替换掉 Effect 里旧 `onTick` 函数,于是最终的效果就是 `setCount(0 + 1)` <br/>

0 comments on commit cf6f6f5

Please sign in to comment.